From: Ilkka Ollakka Date: Thu, 29 Apr 2010 09:41:08 +0000 (+0300) Subject: avcodec: default to 2 threads on encoding X-Git-Tag: 1.2.0-pre1~6845 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6aa2e63da7d3f73b922027d5c07cb91ab7065459;p=vlc avcodec: default to 2 threads on encoding Multiple cores are pretty common nowdays, so shouldn't be big issue. Maybe better would be implement cpu-core counter, like in x264, but at the moment only avcodec-module doesn't seem to handle i_threads=0 as automatic. --- diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c index fb5c83dad6..54aa3a6210 100644 --- a/modules/codec/avcodec/encoder.c +++ b/modules/codec/avcodec/encoder.c @@ -499,6 +499,8 @@ int OpenEncoder( vlc_object_t *p_this ) if ( p_enc->i_threads >= 1 ) avcodec_thread_init( p_context, p_enc->i_threads ); + else + avcodec_thread_init( p_context, 2 ); if( p_sys->i_vtolerance > 0 ) p_context->bit_rate_tolerance = p_sys->i_vtolerance;