Title: [278488] branches/safari-611-branch/Source/WebCore
Revision
278488
Author
alanc...@apple.com
Date
2021-06-04 13:24:14 -0700 (Fri, 04 Jun 2021)

Log Message

Cherry-pick r276359. rdar://problem/78875297

    Integrator's note: did some conflict resolution here. Did a partial find-and-replace to update pullSamples as well.

    AudioMediaStreamTrackRendererUnit should not have its data zeroed if one track has not enough data
    https://bugs.webkit.org/show_bug.cgi?id=224673

    Reviewed by Eric Carlson.

    AudioMediaStreamTrackRendererUnit may get data from multiple tracks.
    If one track has not enough data, AudioSampleDataSource will zero the buffer while it should leave it unchanged.
    If all tracks do not have enough data, AudioMediaStreamTrackRendererUnit will have silent output as the first track will actually zero the buffer.

    Manually tested.

    * platform/audio/cocoa/AudioSampleDataSource.mm:
    (WebCore::AudioSampleDataSource::pullSamplesInternal):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276359 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (278487 => 278488)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-06-04 20:24:12 UTC (rev 278487)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-06-04 20:24:14 UTC (rev 278488)
@@ -1,3 +1,41 @@
+2021-06-04  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r276359. rdar://problem/78875297
+
+    Integrator's note: did some conflict resolution here. Did a partial find-and-replace to update pullSamples as well.
+    
+    AudioMediaStreamTrackRendererUnit should not have its data zeroed if one track has not enough data
+    https://bugs.webkit.org/show_bug.cgi?id=224673
+    
+    Reviewed by Eric Carlson.
+    
+    AudioMediaStreamTrackRendererUnit may get data from multiple tracks.
+    If one track has not enough data, AudioSampleDataSource will zero the buffer while it should leave it unchanged.
+    If all tracks do not have enough data, AudioMediaStreamTrackRendererUnit will have silent output as the first track will actually zero the buffer.
+    
+    Manually tested.
+    
+    * platform/audio/cocoa/AudioSampleDataSource.mm:
+    (WebCore::AudioSampleDataSource::pullSamplesInternal):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-04-21  Youenn Fablet  <you...@apple.com>
+
+            AudioMediaStreamTrackRendererUnit should not have its data zeroed if one track has not enough data
+            https://bugs.webkit.org/show_bug.cgi?id=224673
+
+            Reviewed by Eric Carlson.
+
+            AudioMediaStreamTrackRendererUnit may get data from multiple tracks.
+            If one track has not enough data, AudioSampleDataSource will zero the buffer while it should leave it unchanged.
+            If all tracks do not have enough data, AudioMediaStreamTrackRendererUnit will have silent output as the first track will actually zero the buffer.
+
+            Manually tested.
+
+            * platform/audio/cocoa/AudioSampleDataSource.mm:
+            (WebCore::AudioSampleDataSource::pullSamplesInternal):
+
 2021-06-01  Ryan Haddad  <ryanhad...@apple.com>
 
         Cherry-pick r273486. rdar://problem/75902605

Modified: branches/safari-611-branch/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm (278487 => 278488)


--- branches/safari-611-branch/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm	2021-06-04 20:24:12 UTC (rev 278487)
+++ branches/safari-611-branch/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm	2021-06-04 20:24:14 UTC (rev 278488)
@@ -213,12 +213,14 @@
 
     ASSERT(buffer.mNumberBuffers == m_ringBuffer->channelCount());
     if (buffer.mNumberBuffers != m_ringBuffer->channelCount()) {
-        AudioSampleBufferList::zeroABL(buffer, byteCount);
+        if (mode != AudioSampleDataSource::Mix)
+            AudioSampleBufferList::zeroABL(buffer, byteCount);
         return false;
     }
 
     if (!m_ringBuffer || m_muted || m_inputSampleOffset == MediaTime::invalidTime()) {
-        AudioSampleBufferList::zeroABL(buffer, byteCount);
+        if (mode != AudioSampleDataSource::Mix)
+            AudioSampleBufferList::zeroABL(buffer, byteCount);
         return false;
     }
 
@@ -229,7 +231,8 @@
     if (m_shouldComputeOutputSampleOffset) {
         uint64_t buffered = endFrame - startFrame;
         if (buffered < sampleCount * 2 || (m_endFrameWhenNotEnoughData && m_endFrameWhenNotEnoughData == endFrame)) {
-            AudioSampleBufferList::zeroABL(buffer, byteCount);
+            if (mode != AudioSampleDataSource::Mix)
+                AudioSampleBufferList::zeroABL(buffer, byteCount);
             return false;
         }
 
@@ -263,7 +266,8 @@
                 ALWAYS_LOG(logIdentifier, "updating offset to ", outputSampleOffset);
             });
         }
-        AudioSampleBufferList::zeroABL(buffer, byteCount);
+        if (mode != AudioSampleDataSource::Mix)
+            AudioSampleBufferList::zeroABL(buffer, byteCount);
         return false;
     }
 
@@ -335,7 +339,8 @@
 {
     if (!m_ringBuffer) {
         size_t byteCount = sampleCount * m_outputDescription->bytesPerFrame();
-        AudioSampleBufferList::zeroABL(buffer, byteCount);
+        if (mode != AudioSampleDataSource::Mix)
+            AudioSampleBufferList::zeroABL(buffer, byteCount);
         return false;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to