Changeset 251356 in webkit
- Timestamp:
- Oct 20, 2019 5:44:32 PM (5 years ago)
- Location:
- branches/safari-608-branch/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608-branch/Source/WebCore/ChangeLog
r251353 r251356 1 2019-10-20 Babak Shafiei <bshafiei@apple.com> 2 3 Cherry-pick r251188. rdar://problem/56340816 4 5 WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly 6 https://bugs.webkit.org/show_bug.cgi?id=202930 7 <rdar://problem/56006776> 8 9 Reviewed by Eric Carlson. 10 11 Source/WebCore: 12 13 There is a time where the bus channel number and audio source channel numbers may be different. 14 In case the bus channel number is less than the audio source channel number, initialization of 15 the WebAudioBufferList might not be fully done. 16 In that case, output silence and return early. 17 Reduce the number of frames to process based on the number of frames the output audio bus plans to process. 18 19 Partially covered by new API test (this a race so we cannot reproduce the crash easily). 20 21 * Modules/webaudio/MediaStreamAudioSourceNode.cpp: 22 (WebCore::MediaStreamAudioSourceNode::process): 23 Make sure to process the number of frames the output bus expect. 24 * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: 25 (WebCore::WebAudioSourceProviderAVFObjC::provideInput): 26 27 Tools: 28 29 Add a test that has an audio track that goes from 1 to 2 channels while being piped to a WebAudio pipeline. 30 31 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 32 * TestWebKitAPI/Tests/WebKit/GetUserMedia.mm: 33 (-[GUMMessageHandler userContentController:didReceiveScriptMessage:]): 34 (TestWebKitAPI::TEST): 35 * TestWebKitAPI/Tests/WebKit/getUserMedia-webaudio.html: Added. 36 37 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251188 268f45cc-cd09-0410-ab3c-d52691b4dbfc 38 39 2019-10-16 Youenn Fablet <youenn@apple.com> 40 41 WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly 42 https://bugs.webkit.org/show_bug.cgi?id=202930 43 <rdar://problem/56006776> 44 45 Reviewed by Eric Carlson. 46 47 There is a time where the bus channel number and audio source channel numbers may be different. 48 In case the bus channel number is less than the audio source channel number, initialization of 49 the WebAudioBufferList might not be fully done. 50 In that case, output silence and return early. 51 Reduce the number of frames to process based on the number of frames the output audio bus plans to process. 52 53 Partially covered by new API test (this a race so we cannot reproduce the crash easily). 54 55 * Modules/webaudio/MediaStreamAudioSourceNode.cpp: 56 (WebCore::MediaStreamAudioSourceNode::process): 57 Make sure to process the number of frames the output bus expect. 58 * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: 59 (WebCore::WebAudioSourceProviderAVFObjC::provideInput): 60 1 61 2019-10-20 Babak Shafiei <bshafiei@apple.com> 2 62 -
branches/safari-608-branch/Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.cpp
r248090 r251356 132 132 } 133 133 134 if (numberOfFrames > outputBus->length()) 135 numberOfFrames = outputBus->length(); 136 134 137 if (m_multiChannelResampler.get()) { 135 138 ASSERT(m_sourceSampleRate != sampleRate()); -
branches/safari-608-branch/Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm
r239427 r251356 80 80 81 81 WebAudioBufferList list { m_outputDescription.value() }; 82 if (bus->numberOfChannels() < list.bufferCount()) { 83 bus->zero(); 84 return; 85 } 86 82 87 for (unsigned i = 0; i < bus->numberOfChannels(); ++i) { 83 AudioChannel& channel = *bus->channel(i);88 auto& channel = *bus->channel(i); 84 89 if (i >= list.bufferCount()) { 85 90 channel.zero(); … … 92 97 } 93 98 99 ASSERT(framesToProcess <= bus->length()); 94 100 m_dataSource->pullSamples(*list.list(), framesToProcess, m_readCount, 0, AudioSampleDataSource::Copy); 95 101 m_readCount += framesToProcess;
Note: See TracChangeset
for help on using the changeset viewer.