mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 1305826: P3. Only process the number of frames, do not rely on allocated size. r=gerald
This is only for safeguarding, in case an audio buffer was over allocated. There should be none. But better be safe than sorry MozReview-Commit-ID: JszA8CqycTr --HG-- extra : rebase_source : ddeb1ff1f19abba36e4cbb1bab5132f15f5a2a74
This commit is contained in:
parent
baa3b5f5b9
commit
aa4ed2f442
@ -467,8 +467,13 @@ DecodedAudioDataSink::NotifyAudioNeeded()
|
||||
mFramesParsed += data->mFrames;
|
||||
|
||||
if (mConverter->InputConfig() != mConverter->OutputConfig()) {
|
||||
// We must ensure that the size in the buffer contains exactly the number
|
||||
// of frames, in case one of the audio producer over allocated the buffer.
|
||||
AlignedAudioBuffer buffer(Move(data->mAudioData));
|
||||
buffer.SetLength(size_t(data->mFrames) * data->mChannels);
|
||||
|
||||
AlignedAudioBuffer convertedData =
|
||||
mConverter->Process(AudioSampleBuffer(Move(data->mAudioData))).Forget();
|
||||
mConverter->Process(AudioSampleBuffer(Move(buffer))).Forget();
|
||||
data = CreateAudioFromBuffer(Move(convertedData), data);
|
||||
}
|
||||
if (PushProcessedAudio(data)) {
|
||||
|
Loading…
Reference in New Issue
Block a user