# HG changeset patch # User michael # Date 1133560850 0 # Node ID b3ef98ca8677b5c87258f4a3bef61a048337aacf # Parent c3893e949327ec21b1d0755312de658cb0e81f83 multithreaded decoding diff -r c3893e949327 -r b3ef98ca8677 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Fri Dec 02 19:43:36 2005 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Fri Dec 02 22:00:50 2005 +0000 @@ -111,6 +111,7 @@ static char *lavc_param_skip_idct_str = NULL; static char *lavc_param_skip_frame_str = NULL; #endif +static int lavc_param_threads=1; m_option_t lavc_decode_opts_conf[]={ {"bug", &lavc_param_workaround_bugs, CONF_TYPE_INT, CONF_RANGE, -1, 999999, NULL}, @@ -132,6 +133,7 @@ {"skipidct", &lavc_param_skip_idct_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"skipframe", &lavc_param_skip_frame_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif + {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; @@ -407,6 +409,10 @@ if(sh->bih) avctx->bits_per_sample= sh->bih->biBitCount; +#if LIBAVCODEC_BUILD >= 4716 + if(lavc_param_threads > 1) + avcodec_thread_init(avctx, lavc_param_threads); +#endif /* open it */ if (avcodec_open(avctx, lavc_codec) < 0) { mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantOpenCodec);