[vlc-commits] commit: avcodec: default to 2 threads on encoding (Ilkka Ollakka )

git at videolan.org git at videolan.org
Thu Apr 29 20:54:22 CEST 2010


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Apr 29 12:41:08 2010 +0300| [6aa2e63da7d3f73b922027d5c07cb91ab7065459] | committer: Ilkka Ollakka 

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6aa2e63da7d3f73b922027d5c07cb91ab7065459
---

 modules/codec/avcodec/encoder.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index fb5c83d..54aa3a6 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;



More information about the vlc-commits mailing list