]> git.sesse.net Git - vlc/commitdiff
avcodec: default to 2 threads on encoding
authorIlkka Ollakka <ileoo@videolan.org>
Thu, 29 Apr 2010 09:41:08 +0000 (12:41 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Thu, 29 Apr 2010 18:50:08 +0000 (21:50 +0300)
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.

modules/codec/avcodec/encoder.c

index fb5c83dad6537887e503be5ca7576adf802ac28a..54aa3a6210651a222e66cc51569bbed6fb1cc1b5 100644 (file)
@@ -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;