changeset 34161:64a0c61c6f18

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.
author reimar
date Mon, 24 Oct 2011 17:44:13 +0000
parents a252f21a07e3
children 9b1b7d46b8d0
files DOCS/man/en/mplayer.1 libmpcodecs/vd_ffmpeg.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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;