From b408c910db3b7eb5bddccff4d420914fb1172994 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 21 Nov 2014 15:29:19 +1300 Subject: [PATCH] Bug 1102658 - Add initial references to the last few AudioData constructor callsites. r=bholley --- dom/media/fmp4/android/AndroidDecoderModule.cpp | 13 +++++++------ dom/media/fmp4/apple/AppleATDecoder.cpp | 14 +++++++------- dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp | 14 +++++++------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/dom/media/fmp4/android/AndroidDecoderModule.cpp b/dom/media/fmp4/android/AndroidDecoderModule.cpp index d9b1780209b..7fa011d90db 100644 --- a/dom/media/fmp4/android/AndroidDecoderModule.cpp +++ b/dom/media/fmp4/android/AndroidDecoderModule.cpp @@ -114,12 +114,13 @@ public: AudioDataValue* audio = new AudioDataValue[aInfo->getSize()]; PodCopy(audio, static_cast(aBuffer), aInfo->getSize()); - mCallback->Output(new AudioData(aInfo->getOffset(), aInfo->getPresentationTimeUs(), - aDuration, - numFrames, - audio, - numChannels, - sampleRate)); + nsRefPtr data = new AudioData(aInfo->getOffset(), aInfo->getPresentationTimeUs(), + aDuration, + numFrames, + audio, + numChannels, + sampleRate); + mCallback->Output(data); return NS_OK; } }; diff --git a/dom/media/fmp4/apple/AppleATDecoder.cpp b/dom/media/fmp4/apple/AppleATDecoder.cpp index 04c4d6c6e0b..cf93d6ac863 100644 --- a/dom/media/fmp4/apple/AppleATDecoder.cpp +++ b/dom/media/fmp4/apple/AppleATDecoder.cpp @@ -267,13 +267,13 @@ AppleATDecoder::SubmitSample(nsAutoPtr aSample) nsAutoArrayPtr 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 audio = new AudioData(aSample->byte_offset, + aSample->composition_timestamp, + duration.value(), + numFrames, + data.forget(), + channels, + rate); mCallback->Output(audio); } diff --git a/dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp b/dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp index 963a0b5b294..2382421affe 100644 --- a/dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp +++ b/dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp @@ -128,13 +128,13 @@ FFmpegAudioDecoder::DecodePacket(MP4Sample* aSample) return; } - AudioData* data = new AudioData(samplePosition, - pts, - duration.value(), - mFrame->nb_samples, - audio.forget(), - numChannels, - samplingRate); + nsRefPtr data = new AudioData(samplePosition, + pts, + duration.value(), + mFrame->nb_samples, + audio.forget(), + numChannels, + samplingRate); mCallback->Output(data); pts += duration.value(); }