From: Brian Matherly Date: Mon, 13 Feb 2012 07:07:14 +0000 (-0800) Subject: Detect video codecs that use the new libavcodec "encode2" method. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f7ca967f25eb7416d561d27df2822dedc06170b7;p=mlt Detect video codecs that use the new libavcodec "encode2" method. --- diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index c5000f96..20e25fa6 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -257,7 +257,11 @@ static int consumer_start( mlt_consumer consumer ) mlt_properties_set_data( properties, "vcodec", codecs, 0, (mlt_destructor) mlt_properties_close, NULL ); mlt_properties_set_data( doc, "video_codecs", codecs, 0, NULL, NULL ); while ( ( codec = av_codec_next( codec ) ) ) +#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(34<<8)+0) + if ( (codec->encode || codec->encode2) && codec->type == CODEC_TYPE_VIDEO ) +#else if ( codec->encode && codec->type == CODEC_TYPE_VIDEO ) +#endif { snprintf( key, sizeof(key), "%d", mlt_properties_count( codecs ) ); mlt_properties_set( codecs, key, codec->name );