Title: [269829] trunk/Source/WebCore
- Revision
- 269829
- Author
- [email protected]
- Date
- 2020-11-15 09:47:17 -0800 (Sun, 15 Nov 2020)
Log Message
AudioSampleDataSource::pullSamplesInternal does not need to pass its sampleCount parameter as in/out
https://bugs.webkit.org/show_bug.cgi?id=218899
Reviewed by Eric Carlson.
pullSamplesInternal sets sampleCount to zero in some cases where pullSamplesInternal returns false.
pullSamplesInternal callers do not use the sampleCount parameter if pullSamplesInternal returns false.
Pass sampleCount by value to clarify the behavior and remove setting sampleCount to zero in pullSamplesInternal return false case.
No change of behavior.
* platform/audio/cocoa/AudioSampleDataSource.h:
* platform/audio/cocoa/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (269828 => 269829)
--- trunk/Source/WebCore/ChangeLog 2020-11-15 16:03:20 UTC (rev 269828)
+++ trunk/Source/WebCore/ChangeLog 2020-11-15 17:47:17 UTC (rev 269829)
@@ -1,3 +1,20 @@
+2020-11-15 Youenn Fablet <[email protected]>
+
+ AudioSampleDataSource::pullSamplesInternal does not need to pass its sampleCount parameter as in/out
+ https://bugs.webkit.org/show_bug.cgi?id=218899
+
+ Reviewed by Eric Carlson.
+
+ pullSamplesInternal sets sampleCount to zero in some cases where pullSamplesInternal returns false.
+ pullSamplesInternal callers do not use the sampleCount parameter if pullSamplesInternal returns false.
+ Pass sampleCount by value to clarify the behavior and remove setting sampleCount to zero in pullSamplesInternal return false case.
+
+ No change of behavior.
+
+ * platform/audio/cocoa/AudioSampleDataSource.h:
+ * platform/audio/cocoa/AudioSampleDataSource.mm:
+ (WebCore::AudioSampleDataSource::pullSamplesInternal):
+
2020-11-15 Zalan Bujtas <[email protected]>
"Typo" in r269821 (by std::numeric_limits<>::min I really meant std::numeric_limits<>::lowest (got tricked by the floating-point type behavior))
Modified: trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.h (269828 => 269829)
--- trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.h 2020-11-15 16:03:20 UTC (rev 269828)
+++ trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.h 2020-11-15 17:47:17 UTC (rev 269829)
@@ -83,7 +83,7 @@
AudioSampleDataSource(size_t, LoggerHelper&);
OSStatus setupConverter();
- bool pullSamplesInternal(AudioBufferList&, size_t&, uint64_t, double, PullMode);
+ bool pullSamplesInternal(AudioBufferList&, size_t, uint64_t, double, PullMode);
void pushSamplesInternal(const AudioBufferList&, const MediaTime&, size_t frameCount);
Modified: trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm (269828 => 269829)
--- trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm 2020-11-15 16:03:20 UTC (rev 269828)
+++ trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm 2020-11-15 17:47:17 UTC (rev 269829)
@@ -207,7 +207,7 @@
return 0;
}
-bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t& sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode)
+bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode)
{
size_t byteCount = sampleCount * m_outputDescription->bytesPerFrame();
@@ -214,13 +214,11 @@
ASSERT(buffer.mNumberBuffers == m_ringBuffer->channelCount());
if (buffer.mNumberBuffers != m_ringBuffer->channelCount()) {
AudioSampleBufferList::zeroABL(buffer, byteCount);
- sampleCount = 0;
return false;
}
if (!m_ringBuffer || m_muted || m_inputSampleOffset == MediaTime::invalidTime()) {
AudioSampleBufferList::zeroABL(buffer, byteCount);
- sampleCount = 0;
return false;
}
@@ -232,7 +230,6 @@
uint64_t buffered = endFrame - startFrame;
if (buffered < sampleCount * 2 || (m_endFrameWhenNotEnoughData && m_endFrameWhenNotEnoughData == endFrame)) {
AudioSampleBufferList::zeroABL(buffer, byteCount);
- sampleCount = 0;
return false;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes