Bug 1102658 - Add initial references to the last few AudioData constructor callsites. r=bholley

This commit is contained in:
Matt Woodrow 2014-11-21 15:29:19 +13:00
parent 498e0af631
commit b408c910db
3 changed files with 21 additions and 20 deletions

View File

@ -114,12 +114,13 @@ public:
AudioDataValue* audio = new AudioDataValue[aInfo->getSize()];
PodCopy(audio, static_cast<AudioDataValue*>(aBuffer), aInfo->getSize());
mCallback->Output(new AudioData(aInfo->getOffset(), aInfo->getPresentationTimeUs(),
aDuration,
numFrames,
audio,
numChannels,
sampleRate));
nsRefPtr<AudioData> data = new AudioData(aInfo->getOffset(), aInfo->getPresentationTimeUs(),
aDuration,
numFrames,
audio,
numChannels,
sampleRate);
mCallback->Output(data);
return NS_OK;
}
};

View File

@ -267,13 +267,13 @@ AppleATDecoder::SubmitSample(nsAutoPtr<mp4_demuxer::MP4Sample> aSample)
nsAutoArrayPtr<AudioDataValue>
data(new AudioDataValue[outputData.Length()]);
PodCopy(data.get(), &outputData[0], outputData.Length());
AudioData* audio = new AudioData(aSample->byte_offset,
aSample->composition_timestamp,
duration.value(),
numFrames,
data.forget(),
channels,
rate);
nsRefPtr<AudioData> audio = new AudioData(aSample->byte_offset,
aSample->composition_timestamp,
duration.value(),
numFrames,
data.forget(),
channels,
rate);
mCallback->Output(audio);
}

View File

@ -128,13 +128,13 @@ FFmpegAudioDecoder<LIBAV_VER>::DecodePacket(MP4Sample* aSample)
return;
}
AudioData* data = new AudioData(samplePosition,
pts,
duration.value(),
mFrame->nb_samples,
audio.forget(),
numChannels,
samplingRate);
nsRefPtr<AudioData> data = new AudioData(samplePosition,
pts,
duration.value(),
mFrame->nb_samples,
audio.forget(),
numChannels,
samplingRate);
mCallback->Output(data);
pts += duration.value();
}