Changeset 267530 in webkit
- Timestamp:
- Sep 24, 2020, 8:11:31 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/audio/mac/AudioSampleDataSource.h (modified) (1 diff)
-
platform/audio/mac/AudioSampleDataSource.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267528 r267530 1 2020-09-24 Youenn Fablet <youenn@apple.com> 2 3 Regression(r265280) Web Audio sources malfunction when disconnected from the audio graph 4 https://bugs.webkit.org/show_bug.cgi?id=216703 5 <rdar://problem/69158436> 6 7 Reviewed by Eric Carlson. 8 9 In case of an audio source that stops producing data, but does not end or mute the track, 10 we would continuously try to read the data until getting to the end of the data. 11 When reaching the end of the data, we would return silence and go back in time a little bit 12 to restart playing with some margin. This allows to read just one chunk of audio until we are back to the end of data. 13 14 We fix this by storing the end of the data counter when reaching it. 15 When trying to pull some more data, we will go back in time a little bit only if some more data was added in the meantime. 16 Otherwise, we just output silence. 17 18 Covered by manual test. 19 20 * platform/audio/mac/AudioSampleDataSource.h: 21 * platform/audio/mac/AudioSampleDataSource.mm: 22 (WebCore::AudioSampleDataSource::pullSamplesInternal): 23 1 24 2020-09-24 Antti Koivisto <antti@apple.com> 2 25 -
trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.h
r265280 r267530 115 115 bool m_muted { false }; 116 116 bool m_shouldComputeOutputSampleOffset { true }; 117 uint64_t m_endFrameWhenNotEnoughData { 0 }; 117 118 118 119 #if !RELEASE_LOG_DISABLED -
trunk/Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm
r265280 r267530 233 233 if (m_shouldComputeOutputSampleOffset) { 234 234 uint64_t buffered = endFrame - startFrame; 235 if (buffered < sampleCount * 2 ) {235 if (buffered < sampleCount * 2 || (m_endFrameWhenNotEnoughData && m_endFrameWhenNotEnoughData == endFrame)) { 236 236 AudioSampleBufferList::zeroABL(buffer, byteCount); 237 237 sampleCount = 0; … … 240 240 241 241 m_shouldComputeOutputSampleOffset = false; 242 m_endFrameWhenNotEnoughData = 0; 242 243 243 244 m_outputSampleOffset = (endFrame - sampleCount) - timeStamp; … … 258 259 // We are out of the window, let's restart the offset computation. 259 260 m_shouldComputeOutputSampleOffset = true; 261 262 if (timeStamp >= endFrame) 263 m_endFrameWhenNotEnoughData = endFrame; 260 264 } else { 261 265 // We are too close from endFrame, let's back up a little bit.
Note:
See TracChangeset
for help on using the changeset viewer.