Title: [222109] trunk/Source/WebCore
- Revision
- 222109
- Author
- [email protected]
- Date
- 2017-09-15 13:39:39 -0700 (Fri, 15 Sep 2017)
Log Message
ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
https://bugs.webkit.org/show_bug.cgi?id=175164
<rdar://problem/33712305>
Patch by Youenn Fablet <[email protected]> on 2017-09-15
Reviewed by Eric Carlson.
No observable change of behavior.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
(WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
* platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (222108 => 222109)
--- trunk/Source/WebCore/ChangeLog 2017-09-15 20:36:27 UTC (rev 222108)
+++ trunk/Source/WebCore/ChangeLog 2017-09-15 20:39:39 UTC (rev 222109)
@@ -1,5 +1,20 @@
2017-09-15 Youenn Fablet <[email protected]>
+ ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
+ https://bugs.webkit.org/show_bug.cgi?id=175164
+ <rdar://problem/33712305>
+
+ Reviewed by Eric Carlson.
+
+ No observable change of behavior.
+
+ * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
+ (WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
+ (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
+ * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
+
+2017-09-15 Youenn Fablet <[email protected]>
+
Move code using Vector::map to WTF:map
https://bugs.webkit.org/show_bug.cgi?id=176860
Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp (222108 => 222109)
--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp 2017-09-15 20:36:27 UTC (rev 222108)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp 2017-09-15 20:39:39 UTC (rev 222109)
@@ -134,6 +134,15 @@
return writtenAudioDuration < readAudioDuration + 0.1;
}
+bool RealtimeOutgoingAudioSource::hasBufferedEngouhData()
+{
+ auto writtenAudioDuration = m_writeCount / m_inputStreamDescription.sampleRate();
+ auto readAudioDuration = m_readCount / m_outputStreamDescription.sampleRate();
+
+ ASSERT(writtenAudioDuration >= readAudioDuration);
+ return writtenAudioDuration >= readAudioDuration + 0.01;
+}
+
void RealtimeOutgoingAudioSource::audioSamplesAvailable(const MediaTime&, const PlatformAudioData& audioData, const AudioStreamDescription& streamDescription, size_t sampleCount)
{
if (m_inputStreamDescription != streamDescription) {
@@ -161,6 +170,9 @@
m_sampleConverter->pushSamples(MediaTime(m_writeCount, static_cast<uint32_t>(m_inputStreamDescription.sampleRate())), audioData, sampleCount);
m_writeCount += sampleCount;
+ if (!hasBufferedEngouhData())
+ return;
+
LibWebRTCProvider::callOnWebRTCSignalingThread([protectedThis = makeRef(*this)] {
protectedThis->pullAudioData();
});
Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h (222108 => 222109)
--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h 2017-09-15 20:36:27 UTC (rev 222108)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h 2017-09-15 20:39:39 UTC (rev 222109)
@@ -73,6 +73,7 @@
bool isReachingBufferedAudioDataHighLimit();
bool isReachingBufferedAudioDataLowLimit();
+ bool hasBufferedEngouhData();
// MediaStreamTrackPrivate::Observer API
void trackMutedChanged(MediaStreamTrackPrivate&) final { sourceMutedChanged(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes