Bug 1035059 - Fix releasing of libav frames; r=edwin

This commit is contained in:
Anthony Jones 2014-07-11 18:43:57 +12:00
parent 4ee73488db
commit 8c31b563c1
2 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@ FFmpegDataDecoder<LIBAV_VER>::Init()
mCodecContext.get_format = ChoosePixelFormat; mCodecContext.get_format = ChoosePixelFormat;
mCodecContext.thread_count = PR_GetNumberOfProcessors(); mCodecContext.thread_count = PR_GetNumberOfProcessors();
mCodecContext.thread_type = FF_THREAD_FRAME; mCodecContext.thread_type = FF_THREAD_SLICE | FF_THREAD_FRAME;
mCodecContext.thread_safe_callbacks = false; mCodecContext.thread_safe_callbacks = false;
mCodecContext.extradata = mExtraData.begin(); mCodecContext.extradata = mExtraData.begin();

View File

@ -137,7 +137,11 @@ FFmpegH264Decoder<LIBAV_VER>::AllocateBufferCb(AVCodecContext* aCodecContext,
FFmpegH264Decoder<LIBAV_VER>::ReleaseBufferCb(AVCodecContext* aCodecContext, FFmpegH264Decoder<LIBAV_VER>::ReleaseBufferCb(AVCodecContext* aCodecContext,
AVFrame* aFrame) AVFrame* aFrame)
{ {
reinterpret_cast<Image*>(aFrame->opaque)->Release(); Image* image = reinterpret_cast<Image*>(aFrame->opaque);
avcodec_default_release_buffer(aCodecContext, aFrame);
if (image) {
image->Release();
}
} }
int int