Changeset 269829 in webkit
- Timestamp:
- Nov 15, 2020 9:47:17 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269828 r269829 1 2020-11-15 Youenn Fablet <youenn@apple.com> 2 3 AudioSampleDataSource::pullSamplesInternal does not need to pass its sampleCount parameter as in/out 4 https://bugs.webkit.org/show_bug.cgi?id=218899 5 6 Reviewed by Eric Carlson. 7 8 pullSamplesInternal sets sampleCount to zero in some cases where pullSamplesInternal returns false. 9 pullSamplesInternal callers do not use the sampleCount parameter if pullSamplesInternal returns false. 10 Pass sampleCount by value to clarify the behavior and remove setting sampleCount to zero in pullSamplesInternal return false case. 11 12 No change of behavior. 13 14 * platform/audio/cocoa/AudioSampleDataSource.h: 15 * platform/audio/cocoa/AudioSampleDataSource.mm: 16 (WebCore::AudioSampleDataSource::pullSamplesInternal): 17 1 18 2020-11-15 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.h
r268521 r269829 84 84 85 85 OSStatus setupConverter(); 86 bool pullSamplesInternal(AudioBufferList&, size_t &, uint64_t, double, PullMode);86 bool pullSamplesInternal(AudioBufferList&, size_t, uint64_t, double, PullMode); 87 87 88 88 void pushSamplesInternal(const AudioBufferList&, const MediaTime&, size_t frameCount); -
trunk/Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm
r268577 r269829 208 208 } 209 209 210 bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t &sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode)210 bool AudioSampleDataSource::pullSamplesInternal(AudioBufferList& buffer, size_t sampleCount, uint64_t timeStamp, double /*hostTime*/, PullMode mode) 211 211 { 212 212 size_t byteCount = sampleCount * m_outputDescription->bytesPerFrame(); … … 215 215 if (buffer.mNumberBuffers != m_ringBuffer->channelCount()) { 216 216 AudioSampleBufferList::zeroABL(buffer, byteCount); 217 sampleCount = 0;218 217 return false; 219 218 } … … 221 220 if (!m_ringBuffer || m_muted || m_inputSampleOffset == MediaTime::invalidTime()) { 222 221 AudioSampleBufferList::zeroABL(buffer, byteCount); 223 sampleCount = 0;224 222 return false; 225 223 } … … 233 231 if (buffered < sampleCount * 2 || (m_endFrameWhenNotEnoughData && m_endFrameWhenNotEnoughData == endFrame)) { 234 232 AudioSampleBufferList::zeroABL(buffer, byteCount); 235 sampleCount = 0;236 233 return false; 237 234 }
Note: See TracChangeset
for help on using the changeset viewer.