You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-libs/mlt/files/mlt-0.8.2-av_codec_is_encod...

33 lines
1.4 KiB

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