multi-threaded lavc patch by (Loren Merritt <lorenm at u dot washington dot edu>)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12761 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2004-07-06 02:10:22 +00:00
parent 12066db435
commit acc4477cf3
2 changed files with 15 additions and 0 deletions

8
configure vendored
View File

@ -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

View File

@ -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);