Changeset 267686 in webkit
- Timestamp:
- Sep 27, 2020, 1:00:50 PM (6 years ago)
- Location:
- branches/safari-610-branch/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
-
branches/safari-610-branch/Source/WebCore/ChangeLog
r267682 r267686 1 2020-09-27 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r267530. rdar://problem/69594070 4 5 Regression(r265280) Web Audio sources malfunction when disconnected from the audio graph 6 https://bugs.webkit.org/show_bug.cgi?id=216703 7 <rdar://problem/69158436> 8 9 Reviewed by Eric Carlson. 10 11 In case of an audio source that stops producing data, but does not end or mute the track, 12 we would continuously try to read the data until getting to the end of the data. 13 When reaching the end of the data, we would return silence and go back in time a little bit 14 to restart playing with some margin. This allows to read just one chunk of audio until we are back to the end of data. 15 16 We fix this by storing the end of the data counter when reaching it. 17 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. 18 Otherwise, we just output silence. 19 20 Covered by manual test. 21 22 * platform/audio/mac/AudioSampleDataSource.h: 23 * platform/audio/mac/AudioSampleDataSource.mm: 24 (WebCore::AudioSampleDataSource::pullSamplesInternal): 25 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267530 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2020-09-24 Youenn Fablet <youenn@apple.com> 30 31 Regression(r265280) Web Audio sources malfunction when disconnected from the audio graph 32 https://bugs.webkit.org/show_bug.cgi?id=216703 33 <rdar://problem/69158436> 34 35 Reviewed by Eric Carlson. 36 37 In case of an audio source that stops producing data, but does not end or mute the track, 38 we would continuously try to read the data until getting to the end of the data. 39 When reaching the end of the data, we would return silence and go back in time a little bit 40 to restart playing with some margin. This allows to read just one chunk of audio until we are back to the end of data. 41 42 We fix this by storing the end of the data counter when reaching it. 43 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. 44 Otherwise, we just output silence. 45 46 Covered by manual test. 47 48 * platform/audio/mac/AudioSampleDataSource.h: 49 * platform/audio/mac/AudioSampleDataSource.mm: 50 (WebCore::AudioSampleDataSource::pullSamplesInternal): 51 1 52 2020-09-27 Alan Coon <alancoon@apple.com> 2 53 -
branches/safari-610-branch/Source/WebCore/platform/audio/mac/AudioSampleDataSource.h
r265280 r267686 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 -
branches/safari-610-branch/Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm
r265280 r267686 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.