]> git.sesse.net Git - mlt/commitdiff
Fix multi-threaded encoding on libavcodec older than v53.
authorDan Dennedy <dan@dennedy.org>
Wed, 28 Sep 2011 01:35:38 +0000 (18:35 -0700)
committerDan Dennedy <dan@dennedy.org>
Wed, 28 Sep 2011 01:35:38 +0000 (18:35 -0700)
src/modules/avformat/consumer_avformat.c

index b02e202ad7d2859b4db35c215040e1b0ed0b0972..1db204299ff83c3df13f64f34a34acb22449b351 100644 (file)
@@ -634,8 +634,12 @@ static AVStream *add_video_stream( mlt_consumer consumer, AVFormatContext *oc, A
                if ( thread_count == 0 && getenv( "MLT_AVFORMAT_THREADS" ) )
                        thread_count = atoi( getenv( "MLT_AVFORMAT_THREADS" ) );
                if ( thread_count > 1 )
+#if LIBAVCODEC_VERSION_MAJOR >= 53
                        c->thread_count = thread_count;
-       
+#else
+                       avcodec_thread_init( c, thread_count );
+#endif
+
                // Process properties as AVOptions
                char *vpre = mlt_properties_get( properties, "vpre" );
                if ( vpre )