Title: [217058] trunk/Source/WebCore
Revision
217058
Author
[email protected]
Date
2017-05-18 12:07:55 -0700 (Thu, 18 May 2017)

Log Message

RealtimeOutgoingAudioSource should use the source sample rate
https://bugs.webkit.org/show_bug.cgi?id=172297

Patch by Youenn Fablet <[email protected]> on 2017-05-18
Reviewed by Eric Carlson.

Covered by manual tests.

* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Using the audio source sample rate so that the converter does the right conversion.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (217057 => 217058)


--- trunk/Source/WebCore/ChangeLog	2017-05-18 18:57:10 UTC (rev 217057)
+++ trunk/Source/WebCore/ChangeLog	2017-05-18 19:07:55 UTC (rev 217058)
@@ -1,3 +1,15 @@
+2017-05-18  Youenn Fablet  <[email protected]>
+
+        RealtimeOutgoingAudioSource should use the source sample rate
+        https://bugs.webkit.org/show_bug.cgi?id=172297
+
+        Reviewed by Eric Carlson.
+
+        Covered by manual tests.
+
+        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
+        (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Using the audio source sample rate so that the converter does the right conversion.
+
 2017-05-18  Andy Estes  <[email protected]>
 
         Add "countryCode" to ApplePayErrorContactField

Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp (217057 => 217058)


--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp	2017-05-18 18:57:10 UTC (rev 217057)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp	2017-05-18 19:07:55 UTC (rev 217058)
@@ -93,8 +93,10 @@
         status = m_sampleConverter->setOutputFormat(m_outputStreamDescription.streamDescription());
         ASSERT(!status);
     }
-
-    m_sampleConverter->pushSamples(MediaTime(m_writeCount, LibWebRTCAudioFormat::sampleRate), audioData, sampleCount);
+    
+    // If we change the audio track or its sample rate changes, the timestamp based on m_writeCount may be wrong.
+    // FIXME: We should update m_writeCount to be valid according the new sampleRate.
+    m_sampleConverter->pushSamples(MediaTime(m_writeCount, static_cast<uint32_t>(m_inputStreamDescription.sampleRate())), audioData, sampleCount);
     m_writeCount += sampleCount;
 
     LibWebRTCProvider::callOnWebRTCSignalingThread([protectedThis = makeRef(*this)] {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to