summaryrefslogtreecommitdiff
blob: 3d0ba1ceb2aac6d067f94248f9e1a270f6e3cb31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
AVCodec.encode has been renamed recently is ffmpeg, causing mlt to fail to build.
Starting from libavcodec 54.7 we have av_codec_is_encoder available publicly so
use this instead.

Index: mlt-0.8.2/src/modules/avformat/consumer_avformat.c
===================================================================
--- mlt-0.8.2.orig/src/modules/avformat/consumer_avformat.c
+++ mlt-0.8.2/src/modules/avformat/consumer_avformat.c
@@ -238,7 +238,11 @@ static int consumer_start( mlt_consumer
 		mlt_properties_set_data( doc, "audio_codecs", codecs, 0, NULL, NULL );
 		while ( ( codec = av_codec_next( codec ) ) )
 #if LIBAVCODEC_VERSION_INT >= ((54<<16)+(0<<8)+0)
+#if LIBAVCODEC_VERSION_INT >= ((54<<16)+(7<<8)+0)
+			if ( av_codec_is_encoder(codec) && codec->type == CODEC_TYPE_AUDIO )
+#else
 			if ( ( codec->encode || codec->encode2 ) && codec->type == CODEC_TYPE_AUDIO )
+#endif
 #else
 			if ( codec->encode && codec->type == CODEC_TYPE_AUDIO )
 #endif
@@ -262,7 +266,11 @@ static int consumer_start( mlt_consumer
 		mlt_properties_set_data( doc, "video_codecs", codecs, 0, NULL, NULL );
 		while ( ( codec = av_codec_next( codec ) ) )
 #if LIBAVCODEC_VERSION_INT >= ((54<<16)+(0<<8)+0)
+#if LIBAVCODEC_VERSION_INT >= ((54<<16)+(7<<8)+0)
+			if ( av_codec_is_encoder(codec) && codec->type == CODEC_TYPE_VIDEO )
+#else
 			if ( (codec->encode || codec->encode2) && codec->type == CODEC_TYPE_VIDEO )
+#endif
 #else
 			if ( codec->encode && codec->type == CODEC_TYPE_VIDEO )
 #endif