# HG changeset patch # User reimar # Date 1319478253 0 # Node ID 64a0c61c6f184369b33922e06941f856d8cf2cec # Parent a252f21a07e31caaa3ca097b2e4d01fe684a9633 Add a vd_ffmpeg option to make the decoder discard frames until the first keyframe after startup or seek. Restore the previous default behaviour since in actual playback scenarios long delays are far more annoying than seeing a few broken frames. diff -r a252f21a07e3 -r 64a0c61c6f18 DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Mon Oct 24 16:22:10 2011 +0000 +++ b/DOCS/man/en/mplayer.1 Mon Oct 24 17:44:13 2011 +0000 @@ -5155,6 +5155,9 @@ .REss .IPs vstats Prints some statistics and stores them in ./vstats_*.log. +.IPs wait_keyframe +Wait for a keyframe before displaying anything. +Avoids broken frames at startup or after seeking with some formats. .RE . .TP diff -r a252f21a07e3 -r 64a0c61c6f18 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Mon Oct 24 16:22:10 2011 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Mon Oct 24 17:44:13 2011 +0000 @@ -91,6 +91,7 @@ static int lavc_param_idct_algo=0; static int lavc_param_debug=0; static int lavc_param_vismv=0; +static int lavc_param_wait_keyframe=0; static int lavc_param_skip_top=0; static int lavc_param_skip_bottom=0; static int lavc_param_fast=0; @@ -119,6 +120,9 @@ {"vstats" , &lavc_param_vstats , CONF_TYPE_FLAG , 0, 0, 1, NULL}, {"debug" , &lavc_param_debug , CONF_TYPE_INT , CONF_RANGE, 0, 9999999, NULL}, {"vismv" , &lavc_param_vismv , CONF_TYPE_INT , CONF_RANGE, 0, 9999999, NULL}, +#ifdef CODEC_FLAG2_SHOW_ALL + {"wait_keyframe" , &lavc_param_wait_keyframe , CONF_TYPE_FLAG , 0, 0, CODEC_FLAG_PART, NULL}, +#endif {"st" , &lavc_param_skip_top , CONF_TYPE_INT , CONF_RANGE, 0, 999, NULL}, {"sb" , &lavc_param_skip_bottom , CONF_TYPE_INT , CONF_RANGE, 0, 999, NULL}, {"fast" , &lavc_param_fast , CONF_TYPE_FLAG , 0, 0, CODEC_FLAG2_FAST, NULL}, @@ -261,6 +265,9 @@ avctx->workaround_bugs= lavc_param_workaround_bugs; avctx->error_recognition= lavc_param_error_resilience; if(lavc_param_gray) avctx->flags|= CODEC_FLAG_GRAY; +#ifdef CODEC_FLAG2_SHOW_ALL + if(!lavc_param_wait_keyframe) avctx->flags2 |= CODEC_FLAG2_SHOW_ALL; +#endif avctx->flags2|= lavc_param_fast; avctx->codec_tag= sh->format; avctx->stream_codec_tag= sh->video.fccHandler;