Title: [275538] trunk/Source/WebCore
Revision
275538
Author
eric.carl...@apple.com
Date
2021-04-06 12:38:33 -0700 (Tue, 06 Apr 2021)

Log Message

[Cocoa] audio played at 2x speed video is not pitch corrected
https://bugs.webkit.org/show_bug.cgi?id=224238
rdar://75868284

Reviewed by Jer Noble.

We need to use the _intended_ playback rate when deciding which pitch correction
algorithm to use. MediaPlayerPrivateAVFoundationObjC::m_cachedRate is used for this,
but r274592 stopped setting m_cachedRate in MediaPlayerPrivateAVFoundationObjC::setPlayerRate
because it is also set when AVPlayer KVOs that the rate changed.

Tested manually.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): Set m_cachedRate.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275537 => 275538)


--- trunk/Source/WebCore/ChangeLog	2021-04-06 19:06:53 UTC (rev 275537)
+++ trunk/Source/WebCore/ChangeLog	2021-04-06 19:38:33 UTC (rev 275538)
@@ -1,3 +1,21 @@
+2021-04-06  Eric Carlson  <eric.carl...@apple.com>
+
+        [Cocoa] audio played at 2x speed video is not pitch corrected
+        https://bugs.webkit.org/show_bug.cgi?id=224238
+        rdar://75868284
+
+        Reviewed by Jer Noble.
+
+        We need to use the _intended_ playback rate when deciding which pitch correction
+        algorithm to use. MediaPlayerPrivateAVFoundationObjC::m_cachedRate is used for this,
+        but r274592 stopped setting m_cachedRate in MediaPlayerPrivateAVFoundationObjC::setPlayerRate
+        because it is also set when AVPlayer KVOs that the rate changed.
+
+        Tested manually.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): Set m_cachedRate.
+
 2021-04-06  David Kilzer  <ddkil...@apple.com>
 
         UBSan: RenderView.cpp:831:9: runtime error: load of value nnn, which is not a valid value for type 'bool'

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (275537 => 275538)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-04-06 19:06:53 UTC (rev 275537)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-04-06 19:38:33 UTC (rev 275538)
@@ -1513,6 +1513,7 @@
 {
     setDelayCallbacks(true);
 
+    m_cachedRate = rate;
     [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_cachedRate)];
 
     setShouldObserveTimeControlStatus(false);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to