Bug 1409272 - P1: Remove unnecessary and/or unused variables. r?jwwang
MozReview-Commit-ID: J9qiqEfU05N
--- a/dom/media/platforms/agnostic/VorbisDecoder.cpp
+++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp
@@ -151,18 +151,16 @@ VorbisDataDecoder::Decode(MediaRawData*
RefPtr<MediaDataDecoder::DecodePromise>
VorbisDataDecoder::ProcessDecode(MediaRawData* aSample)
{
MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
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);
if (!mLastFrameTime ||
mLastFrameTime.ref() != aSample->mTime.ToMicroseconds()) {
// We are starting a new block.
mFrames = 0;
mLastFrameTime = Some(aSample->mTime.ToMicroseconds());
@@ -220,22 +218,22 @@ VorbisDataDecoder::ProcessDecode(MediaRa
auto total_duration = FramesToTimeUnit(mFrames, rate);
if (!total_duration.IsValid()) {
return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
RESULT_DETAIL("Overflow converting audio total_duration")),
__func__);
}
- auto time = total_duration + aTstampUsecs;
+ auto time = total_duration + aSample->mTime;
if (!time.IsValid()) {
return DecodePromise::CreateAndReject(
MediaResult(
NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
- RESULT_DETAIL("Overflow adding total_duration and aTstampUsecs")),
+ RESULT_DETAIL("Overflow adding total_duration and aSample->mTime")),
__func__);
};
if (!mAudioConverter) {
AudioConfig in(
AudioConfig::ChannelLayout(channels, VorbisLayout(channels)), rate);
AudioConfig out(channels, rate);
if (!in.IsValid() || !out.IsValid()) {
@@ -245,18 +243,16 @@ VorbisDataDecoder::ProcessDecode(MediaRa
__func__);
}
mAudioConverter = MakeUnique<AudioConverter>(in, out);
}
MOZ_ASSERT(mAudioConverter->CanWorkInPlace());
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;
err = vorbis_synthesis_read(&mVorbisDsp, frames);
if (err) {
return DecodePromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
RESULT_DETAIL("vorbis_synthesis_read:%d", err)),