Title: [212714] trunk/Source/WebCore
Revision
212714
Author
[email protected]
Date
2017-02-21 09:19:10 -0800 (Tue, 21 Feb 2017)

Log Message

AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
https://bugs.webkit.org/show_bug.cgi?id=168635

Reviewed by Jon Lee.

* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (212713 => 212714)


--- trunk/Source/WebCore/ChangeLog	2017-02-21 16:27:35 UTC (rev 212713)
+++ trunk/Source/WebCore/ChangeLog	2017-02-21 17:19:10 UTC (rev 212714)
@@ -1,3 +1,14 @@
+2017-02-21  Jer Noble  <[email protected]>
+
+        AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
+        https://bugs.webkit.org/show_bug.cgi?id=168635
+
+        Reviewed by Jon Lee.
+
+        * platform/audio/mac/AudioSampleDataSource.cpp:
+        (WebCore::AudioSampleDataSource::pullSamplesInternal):
+        (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
+
 2017-02-21  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r212681): Crash when dragging links without a drag image

Modified: trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp (212713 => 212714)


--- trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp	2017-02-21 16:27:35 UTC (rev 212713)
+++ trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp	2017-02-21 17:19:10 UTC (rev 212714)
@@ -207,16 +207,17 @@
 bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t& sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode)
 {
     ASSERT(m_lock.isHeld());
+    size_t byteCount = sampleCount * m_outputDescription->bytesPerFrame();
 
     ASSERT(buffer.mNumberBuffers == m_ringBuffer->channelCount());
     if (buffer.mNumberBuffers != m_ringBuffer->channelCount()) {
-        AudioSampleBufferList::zeroABL(buffer, sampleCount);
+        AudioSampleBufferList::zeroABL(buffer, byteCount);
         sampleCount = 0;
         return false;
     }
 
     if (!m_ringBuffer || m_muted || m_inputSampleOffset == MediaTime::invalidTime()) {
-        AudioSampleBufferList::zeroABL(buffer, sampleCount);
+        AudioSampleBufferList::zeroABL(buffer, byteCount);
         sampleCount = 0;
         return false;
     }
@@ -228,7 +229,7 @@
     if (m_transitioningFromPaused) {
         uint64_t buffered = endFrame - m_timeStamp;
         if (buffered < sampleCount * 2) {
-            AudioSampleBufferList::zeroABL(buffer, sampleCount);
+            AudioSampleBufferList::zeroABL(buffer, byteCount);
             sampleCount = 0;
             return false;
         }
@@ -264,7 +265,7 @@
         LOG(MediaCaptureSamples, "** pullSamplesInternal: sample %lld is not completely in range [%lld .. %lld], returning %lld frames", timeStamp, startFrame, endFrame, framesAvailable);
 
         if (!framesAvailable) {
-            AudioSampleBufferList::zeroABL(buffer, sampleCount);
+            AudioSampleBufferList::zeroABL(buffer, byteCount);
             return false;
         }
     }
@@ -281,7 +282,7 @@
 
     m_scratchBuffer->applyGain(m_volume);
     if (m_scratchBuffer->copyTo(buffer, sampleCount))
-        AudioSampleBufferList::zeroABL(buffer, sampleCount);
+        AudioSampleBufferList::zeroABL(buffer, byteCount);
 
     return true;
 }
@@ -316,7 +317,8 @@
 {
     std::unique_lock<Lock> lock(m_lock, std::try_to_lock);
     if (!lock.owns_lock() || !m_ringBuffer) {
-        AudioSampleBufferList::zeroABL(buffer, sampleCount);
+        size_t byteCount = sampleCount * m_outputDescription->bytesPerFrame();
+        AudioSampleBufferList::zeroABL(buffer, byteCount);
         return false;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to