From 8a0f0740432772d75dccd47add3844634392f0d5 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 12 Dec 2010 10:23:41 +0000 Subject: [PATCH] vd_ffmpeg: fix MP_IMGTYPE selection for non-ref non-B frames Change direct rendering buffer allocation code to treat non-ref frames like B-frames even if has_b_frames is not set and they are indeed not B-frames (no reordering). Treating it as an I/P frame would violate the assumptions of MPlayer's buffering system, which thinks only the latest previous I/P frame is needed (in addition to one possibly being decoded). In this case the previous I/P frame will still be needed in the future, not the non-ref frame being decoded now. This happens with flv files, as in bug #1079, and this change fixes that corruption. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32700 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index a874b8411c..d493143a34 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -552,7 +552,7 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ return avctx->get_buffer(avctx, pic); } - if(avctx->has_b_frames){ + if(avctx->has_b_frames || ctx->b_count){ type= MP_IMGTYPE_IPB; }else{ type= MP_IMGTYPE_IP; -- 2.11.4.GIT