]> git.sesse.net Git - mlt/commitdiff
Fix codec-specific defaults for libavcodec v53 (3370720).
authorDan Dennedy <dan@dennedy.org>
Fri, 22 Jul 2011 19:06:31 +0000 (12:06 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 22 Jul 2011 22:02:49 +0000 (15:02 -0700)
src/modules/avformat/consumer_avformat.c

index 29425bc93fa44cf6eb902659d1121b8a6e90c079..18886ebcb1bcb2afb6fbc7bba48bfac102d966cd 100644 (file)
@@ -436,7 +436,11 @@ static AVStream *add_audio_stream( mlt_consumer consumer, AVFormatContext *oc, A
                AVCodecContext *c = st->codec;
 
                // Establish defaults from AVOptions
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+               avcodec_get_context_defaults3( c, codec );
+#else
                avcodec_get_context_defaults2( c, CODEC_TYPE_AUDIO );
+#endif
 
                c->codec_id = codec->id;
                c->codec_type = CODEC_TYPE_AUDIO;
@@ -609,7 +613,11 @@ static AVStream *add_video_stream( mlt_consumer consumer, AVFormatContext *oc, A
                AVCodecContext *c = st->codec;
 
                // Establish defaults from AVOptions
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+               avcodec_get_context_defaults3( c, codec );
+#else
                avcodec_get_context_defaults2( c, CODEC_TYPE_VIDEO );
+#endif
 
                c->codec_id = codec->id;
                c->codec_type = CODEC_TYPE_VIDEO;
@@ -1109,6 +1117,7 @@ static void *consumer_thread( void *arg )
                        {
                                mlt_properties_set( properties, "_acodec", "ac3_fixed" );
                                acodec = mlt_properties_get( properties, "_acodec" );
+                               audio_codec = avcodec_find_encoder_by_name( acodec );
                        }
                }
                else