diff --git a/dom/media/platforms/agnostic/VorbisDecoder.cpp b/dom/media/platforms/agnostic/VorbisDecoder.cpp index 0391fed0191e..76ca198070ac 100644 --- a/dom/media/platforms/agnostic/VorbisDecoder.cpp +++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp @@ -156,6 +156,8 @@ VorbisDataDecoder::ProcessDecode(MediaRawData* aSample) const unsigned char* aData = aSample->Data(); size_t aLength = aSample->Size(); int64_t aOffset = aSample->mOffset; + auto aTstampUsecs = aSample->mTime; + int64_t aTotalFrames = 0; MOZ_ASSERT(mPacketCount >= 3); @@ -223,12 +225,12 @@ VorbisDataDecoder::ProcessDecode(MediaRawData* aSample) __func__); } - auto time = total_duration + aSample->mTime; + auto time = total_duration + aTstampUsecs; if (!time.IsValid()) { return DecodePromise::CreateAndReject( MediaResult( NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, - RESULT_DETAIL("Overflow adding total_duration and aSample->mTime")), + RESULT_DETAIL("Overflow adding total_duration and aTstampUsecs")), __func__); }; @@ -248,6 +250,8 @@ VorbisDataDecoder::ProcessDecode(MediaRawData* aSample) AudioSampleBuffer data(Move(buffer)); data = mAudioConverter->Process(Move(data)); + aTotalFrames += frames; + results.AppendElement(new AudioData(aOffset, time, duration, frames, data.Forget(), channels, rate)); mFrames += frames;