Changeset 275538 in webkit


Ignore:
Timestamp:
Apr 6, 2021 12:38:33 PM (3 years ago)
Author:
eric.carlson@apple.com
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275536 r275538  
     12021-04-06  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Cocoa] audio played at 2x speed video is not pitch corrected
     4        https://bugs.webkit.org/show_bug.cgi?id=224238
     5        rdar://75868284
     6
     7        Reviewed by Jer Noble.
     8
     9        We need to use the _intended_ playback rate when deciding which pitch correction
     10        algorithm to use. MediaPlayerPrivateAVFoundationObjC::m_cachedRate is used for this,
     11        but r274592 stopped setting m_cachedRate in MediaPlayerPrivateAVFoundationObjC::setPlayerRate
     12        because it is also set when AVPlayer KVOs that the rate changed.
     13
     14        Tested manually.
     15
     16        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     17        (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): Set m_cachedRate.
     18
    1192021-04-06  David Kilzer  <ddkilzer@apple.com>
    220
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r274734 r275538  
    15141514    setDelayCallbacks(true);
    15151515
     1516    m_cachedRate = rate;
    15161517    [m_avPlayerItem setAudioTimePitchAlgorithm:audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm(player()->pitchCorrectionAlgorithm(), player()->preservesPitch(), m_cachedRate)];
    15171518
Note: See TracChangeset for help on using the changeset viewer.