Modified: trunk/Source/WebCore/ChangeLog (275573 => 275574)
--- trunk/Source/WebCore/ChangeLog 2021-04-07 00:02:02 UTC (rev 275573)
+++ trunk/Source/WebCore/ChangeLog 2021-04-07 00:32:09 UTC (rev 275574)
@@ -1,3 +1,21 @@
+2021-04-06 Eric Carlson <[email protected]>
+
+ REGRESSION (r275538): [ macOS ] TestWebKitAPI.WebKitLegacy.MediaPlaybackSleepAssertion and TestWebKitAPI.SleepDisabler.Pause consistently failing
+ https://bugs.webkit.org/show_bug.cgi?id=224249
+ <rdar://problem/76286539>
+
+ Reviewed by Jer Noble.
+
+ No new tests, this fixes two API tests.
+
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use m_requestedRate
+ when choosing the pitch correction algorithm.
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): Ditto.
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch): Ditto.
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::setPitchCorrectionAlgorithm): Ditto.
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange): Ditto.
+
2021-04-06 Jer Noble <[email protected]>
Unreviewed build fix after 275571: add declaration for new method (and make the constness match).
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (275573 => 275574)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-04-07 00:02:02 UTC (rev 275573)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2021-04-07 00:32:09 UTC (rev 275574)
@@ -1134,7 +1134,7 @@
for (NSString *keyName in itemKVOProperties())
[m_avPlayerItem.get() addObserver:m_objcObserver.get() forKeyPath:keyName options:options context:(void *)MediaPlayerAVFoundationObservationContextPlayerItem];
- [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_cachedRate)];
+ [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_requestedRate)];
#if HAVE(AVFOUNDATION_INTERSTITIAL_EVENTS)
ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
@@ -1513,8 +1513,7 @@
{
setDelayCallbacks(true);
- m_cachedRate = rate;
- [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_cachedRate)];
+ [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_requestedRate)];
setShouldObserveTimeControlStatus(false);
[m_avPlayer setRate:rate];
@@ -1552,13 +1551,13 @@
void MediaPlayerPrivateAVFoundationObjC::setPreservesPitch(bool preservesPitch)
{
if (m_avPlayerItem)
- [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), preservesPitch, m_cachedRate)];
+ [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), preservesPitch, m_requestedRate)];
}
void MediaPlayerPrivateAVFoundationObjC::setPitchCorrectionAlgorithm(MediaPlayer::PitchCorrectionAlgorithm pitchCorrectionAlgorithm)
{
if (m_avPlayerItem)
- [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(pitchCorrectionAlgorithm, player()->preservesPitch(), m_cachedRate)];
+ [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(pitchCorrectionAlgorithm, player()->preservesPitch(), m_requestedRate)];
}
std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges() const
@@ -3042,7 +3041,7 @@
#if !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101400)
// FIXME(rdar://72829354): Remove after AVFoundation radar is fixed.
if (status == AVPlayerItemStatusReadyToPlay)
- [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_cachedRate)];
+ [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_requestedRate)];
#endif
updateStates();