зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1042672 - Avoid mixing in uninitialized buffers in AudioSegment::WriteTo. r=jesup
This commit is contained in:
Родитель
6dfd9b3bbd
Коммит
e993ffd6b5
|
@ -212,7 +212,10 @@ AudioSegment::WriteTo(uint64_t aID, AudioStream* aOutput, AudioMixer* aMixer)
|
|||
|
||||
aOutput->Write(buf.Elements(), offset / outputChannels, &(mChunks[mChunks.Length() - 1].mTimeStamp));
|
||||
|
||||
if (aMixer) {
|
||||
// `offset` is zero when all the chunks above are null (silence). We can
|
||||
// safely skip the mixing here because filling `buf` with zero and then mixing
|
||||
// it would have absolutly no effect in the mix.
|
||||
if (aMixer && offset) {
|
||||
aMixer->Mix(buf.Elements(), outputChannels, GetDuration(), aOutput->GetRate());
|
||||
}
|
||||
aOutput->Start();
|
||||
|
|
Загрузка…
Ссылка в новой задаче