Changeset 252960 in webkit


Ignore:
Timestamp:
Nov 30, 2019 11:07:31 AM (4 years ago)
Author:
youenn@apple.com
Message:

Update RealtimeOutgoingAudioSourceCocoa::m_writeCount when sampleRate changes
https://bugs.webkit.org/show_bug.cgi?id=204606

Reviewed by Eric Carlson.

Source/WebCore:

Update m_writeCount to make sure our high/low buffer computation is done right.

Test: webrtc/audio-samplerate-change.html

  • platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:

(WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):

LayoutTests:

  • webrtc/audio-samplerate-change-expected.txt: Added.
  • webrtc/audio-samplerate-change.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252957 r252960  
     12019-11-30  youenn fablet  <youenn@apple.com>
     2
     3        Update RealtimeOutgoingAudioSourceCocoa::m_writeCount when sampleRate changes
     4        https://bugs.webkit.org/show_bug.cgi?id=204606
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/audio-samplerate-change-expected.txt: Added.
     9        * webrtc/audio-samplerate-change.html: Added.
     10
    1112019-11-30  Antoine Quint  <graouts@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r252959 r252960  
     12019-11-30  youenn fablet  <youenn@apple.com>
     2
     3        Update RealtimeOutgoingAudioSourceCocoa::m_writeCount when sampleRate changes
     4        https://bugs.webkit.org/show_bug.cgi?id=204606
     5
     6        Reviewed by Eric Carlson.
     7
     8        Update m_writeCount to make sure our high/low buffer computation is done right.
     9
     10        Test: webrtc/audio-samplerate-change.html
     11
     12        * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
     13        (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
     14
    1152019-11-30  Antti Koivisto  <antti@apple.com>
    216
  • trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp

    r247522 r252960  
    9292{
    9393    if (m_inputStreamDescription != streamDescription) {
     94        if (m_writeCount && m_inputStreamDescription.sampleRate()) {
     95            // Update m_writeCount to be valid according the new sampleRate.
     96            m_writeCount = (m_writeCount * streamDescription.sampleRate()) / m_inputStreamDescription.sampleRate();
     97        }
     98
    9499        m_inputStreamDescription = toCAAudioStreamDescription(streamDescription);
    95100        auto status  = m_sampleConverter->setInputFormat(m_inputStreamDescription);
     
    111116    }
    112117
    113     // If we change the audio track or its sample rate changes, the timestamp based on m_writeCount may be wrong.
    114     // FIXME: We should update m_writeCount to be valid according the new sampleRate.
    115118    m_sampleConverter->pushSamples(MediaTime(m_writeCount, static_cast<uint32_t>(m_inputStreamDescription.sampleRate())), audioData, sampleCount);
    116119    m_writeCount += sampleCount;
Note: See TracChangeset for help on using the changeset viewer.