]> git.sesse.net Git - vlc/commitdiff
avcodec: use vlc_GetCPUCount() to set thread count also in encoder
authorIlkka Ollakka <ileoo@videolan.org>
Tue, 4 May 2010 10:31:53 +0000 (13:31 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 4 May 2010 10:31:53 +0000 (13:31 +0300)
modules/codec/avcodec/encoder.c

index a39abccc497ed7f616924101e2cd680039ef8ad5..1c0296eb1d9bb8d877ebe1c3f36c27744375273c 100644 (file)
@@ -503,7 +503,7 @@ 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 );
+            avcodec_thread_init( p_context, vlc_GetCPUCount() );
 
         if( p_sys->i_vtolerance > 0 )
             p_context->bit_rate_tolerance = p_sys->i_vtolerance;