diff options
-rwxr-xr-x | configure | 8 | ||||
-rw-r--r-- | libmpcodecs/ve_lavc.c | 7 |
2 files changed, 15 insertions, 0 deletions
@@ -2496,8 +2496,12 @@ else fi if test "$_ld_pthread" != '' ; then echores "yes (using $_ld_pthread)" + _pthreads='yes' + _def_pthreads='#define HAVE_PTHREADS 1' else echores "no" + _pthreads='' + _def_pthreads='#undef HAVE_PTHREADS' fi @@ -6134,6 +6138,7 @@ HAVE_MLIB = $_mlib WIN32_LIB = $_ld_win32libs STATIC_LIB = $_ld_static ENCA_LIB = $_ld_enca +HAVE_PTHREADS = $_pthreads X11_INC = $_inc_x11 X11DIR = $_ld_x11 @@ -6478,6 +6483,9 @@ $_def_gettimeofday /* Define this if your system has glob */ $_def_glob +/* Define this if your system has pthreads */ +$_def_pthreads + /* LIRC (remote control, see www.lirc.org) support: */ $_def_lirc diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index bc5ac55a3f..0569293c03 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -150,6 +150,7 @@ static int lavc_param_top= -1; static int lavc_param_alt= 0; static int lavc_param_ilme= 0; static int lavc_param_nssew= 8; +static int lavc_param_threads= 1; char *lavc_param_acodec = "mp2"; @@ -292,6 +293,7 @@ m_option_t lavcopts_conf[]={ {"top", &lavc_param_top, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, {"qns", &lavc_param_qns, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, {"nssew", &lavc_param_nssew, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, + {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif @@ -661,6 +663,11 @@ static int config(struct vf_instance_s* vf, #endif vf->priv->pic->quality = (int)(FF_QP2LAMBDA * lavc_param_vqscale + 0.5); } + +#if LIBAVCODEC_BUILD >= 4716 + if(lavc_param_threads > 1) + avcodec_thread_init(lavc_venc_context, lavc_param_threads); +#endif if (avcodec_open(lavc_venc_context, vf->priv->codec) != 0) { mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantOpenCodec); |