diff libmpcodecs/vd_ffmpeg.c @ 26395:71bd93e71a97

Restore grayscale decoding support with FFmpeg. Removing support was done due to a silly misunderstanding.
author diego
date Sun, 13 Apr 2008 00:03:11 +0000
parents da6f8ef92918
children 0e325c1957f1
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sat Apr 12 23:28:11 2008 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sun Apr 13 00:03:11 2008 +0000
@@ -71,6 +71,7 @@
 static int lavc_param_workaround_bugs= FF_BUG_AUTODETECT;
 static int lavc_param_error_resilience=2;
 static int lavc_param_error_concealment=3;
+static int lavc_param_gray=0;
 static int lavc_param_vstats=0;
 static int lavc_param_idct_algo=0;
 static int lavc_param_debug=0;
@@ -89,6 +90,7 @@
 const m_option_t lavc_decode_opts_conf[]={
 	{"bug", &lavc_param_workaround_bugs, CONF_TYPE_INT, CONF_RANGE, -1, 999999, NULL},
 	{"er", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL},
+	{"gray", &lavc_param_gray, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART, NULL},
 	{"idct", &lavc_param_idct_algo, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL},
 	{"ec", &lavc_param_error_concealment, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL},
 	{"vstats", &lavc_param_vstats, CONF_TYPE_FLAG, 0, 0, 1, NULL},
@@ -286,6 +288,7 @@
     avctx->height= sh->disp_h;
     avctx->workaround_bugs= lavc_param_workaround_bugs;
     avctx->error_resilience= lavc_param_error_resilience;
+    if(lavc_param_gray) avctx->flags|= CODEC_FLAG_GRAY;
 #ifdef CODEC_FLAG2_FAST
     avctx->flags2|= lavc_param_fast;
 #endif