Changeset 94780 in webkit
- Timestamp:
- Sep 8, 2011 12:22:59 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94779 r94780 1 2011-09-08 Chris Rogers <crogers@google.com> 2 3 Check AudioContext createChannelMerger() for thread safety 4 https://bugs.webkit.org/show_bug.cgi?id=67247 5 6 Reviewed by Kenneth Russell. 7 8 * webaudio/audiochannelmerger-stereo-expected.txt: Added. 9 * webaudio/audiochannelmerger-stereo.html: Added. 10 1 11 2011-09-08 Fady Samuel <fsamuel@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r94778 r94780 1 2011-09-08 Chris Rogers <crogers@google.com> 2 3 Check AudioContext createChannelMerger() for thread safety 4 https://bugs.webkit.org/show_bug.cgi?id=67247 5 6 Reviewed by Kenneth Russell. 7 8 Test: webaudio/audiochannelmerger-stereo.html 9 10 * webaudio/AudioChannelMerger.cpp: 11 (WebCore::AudioChannelMerger::process): 12 (WebCore::AudioChannelMerger::checkNumberOfChannelsForInput): 13 * webaudio/AudioChannelMerger.h: 14 1 15 2011-09-08 Ned Holbrook <nholbrook@apple.com> 2 16 -
trunk/Source/WebCore/webaudio/AudioChannelMerger.cpp
r68732 r94780 33 33 #include "AudioChannelMerger.h" 34 34 35 #include "AudioContext.h" 35 36 #include "AudioNodeInput.h" 36 37 #include "AudioNodeOutput.h" … … 62 63 ASSERT_UNUSED(framesToProcess, framesToProcess == output->bus()->length()); 63 64 64 // Count how many channels we have all together from all of the inputs. 65 unsigned numberOfOutputChannels = 0; 66 for (unsigned i = 0; i < numberOfInputs(); ++i) { 67 AudioNodeInput* input = this->input(i); 68 if (input->isConnected()) 69 numberOfOutputChannels += input->bus()->numberOfChannels(); 70 } 71 72 // Set the correct number of channels on the output 73 output->setNumberOfChannels(numberOfOutputChannels); 74 75 // Now merge the channels back into one output. 65 // Merge all the channels from all the inputs into one output. 76 66 unsigned outputChannelIndex = 0; 77 67 for (unsigned i = 0; i < numberOfInputs(); ++i) { … … 91 81 } 92 82 93 ASSERT(outputChannelIndex == numberOfOutputChannels);83 ASSERT(outputChannelIndex == output->numberOfChannels()); 94 84 } 95 85 … … 98 88 } 99 89 90 // Any time a connection or disconnection happens on any of our inputs, we potentially need to change the 91 // number of channels of our output. 92 void AudioChannelMerger::checkNumberOfChannelsForInput(AudioNodeInput* input) 93 { 94 ASSERT(context()->isAudioThread() && context()->isGraphOwner()); 95 96 // Count how many channels we have all together from all of the inputs. 97 unsigned numberOfOutputChannels = 0; 98 for (unsigned i = 0; i < numberOfInputs(); ++i) { 99 AudioNodeInput* input = this->input(i); 100 if (input->isConnected()) 101 numberOfOutputChannels += input->bus()->numberOfChannels(); 102 } 103 104 // Set the correct number of channels on the output 105 AudioNodeOutput* output = this->output(0); 106 ASSERT(output); 107 output->setNumberOfChannels(numberOfOutputChannels); 108 } 109 100 110 } // namespace WebCore 101 111 -
trunk/Source/WebCore/webaudio/AudioChannelMerger.h
r68732 r94780 48 48 virtual void reset(); 49 49 50 // Called in the audio thread (pre-rendering task) when the number of channels for an input may have changed. 51 virtual void checkNumberOfChannelsForInput(AudioNodeInput*); 52 50 53 private: 51 54 AudioChannelMerger(AudioContext*, double sampleRate);
Note: See TracChangeset
for help on using the changeset viewer.