mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
Bug 1258567 - per comment 3, ensure volume is only applied once to the AudioSegment. r=kinetik.
MozReview-Commit-ID: Bks59JySrep
This commit is contained in:
parent
9602fa95af
commit
8be2af10c1
@ -452,8 +452,7 @@ DecodedStream::SetPreservesPitch(bool aPreservesPitch)
|
||||
|
||||
static void
|
||||
SendStreamAudio(DecodedStreamData* aStream, int64_t aStartTime,
|
||||
MediaData* aData, AudioSegment* aOutput,
|
||||
uint32_t aRate, double aVolume)
|
||||
MediaData* aData, AudioSegment* aOutput, uint32_t aRate)
|
||||
{
|
||||
// The amount of audio frames that is used to fuzz rounding errors.
|
||||
static const int64_t AUDIO_FUZZ_FRAMES = 1;
|
||||
@ -494,7 +493,6 @@ SendStreamAudio(DecodedStreamData* aStream, int64_t aStartTime,
|
||||
}
|
||||
aOutput->AppendFrames(buffer.forget(), channels, audio->mFrames);
|
||||
aStream->mAudioFramesWritten += audio->mFrames;
|
||||
aOutput->ApplyVolume(aVolume);
|
||||
|
||||
aStream->mNextAudioTime = audio->GetEndTime();
|
||||
}
|
||||
@ -518,9 +516,11 @@ DecodedStream::SendAudio(double aVolume, bool aIsSameOrigin)
|
||||
// is ref-counted.
|
||||
mAudioQueue.GetElementsAfter(mData->mNextAudioTime, &audio);
|
||||
for (uint32_t i = 0; i < audio.Length(); ++i) {
|
||||
SendStreamAudio(mData.get(), mStartTime.ref(), audio[i], &output, rate, aVolume);
|
||||
SendStreamAudio(mData.get(), mStartTime.ref(), audio[i], &output, rate);
|
||||
}
|
||||
|
||||
output.ApplyVolume(aVolume);
|
||||
|
||||
if (!aIsSameOrigin) {
|
||||
output.ReplaceWithDisabled();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user