1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 12:55:16 +00:00

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
This commit is contained in:
reimar 2010-12-12 10:23:41 +00:00 committed by Uoti Urpala
parent 3bf9f6c1a7
commit 8a0f074043

View File

@ -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;