]> git.sesse.net Git - mlt/commitdiff
enable codec- and format-specific options for v0.7 releases of ffmpeg
authorDan Dennedy <dan@dennedy.org>
Mon, 16 Jan 2012 04:32:22 +0000 (20:32 -0800)
committerDan Dennedy <dan@dennedy.org>
Mon, 16 Jan 2012 04:32:22 +0000 (20:32 -0800)
(but not libav, which uses v53 of libavformat and libavcodec in its 0.7 releases)

src/modules/avformat/consumer_avformat.c
src/modules/avformat/producer_avformat.c

index b0dc61d0391cf7aafb8d29e237220ac1245e7741..07e80ea9ff8175518f65ef16c077cb6ba840d587 100644 (file)
@@ -554,7 +554,7 @@ static int open_audio( mlt_properties properties, AVFormatContext *oc, AVStream
        else
                codec = avcodec_find_encoder( c->codec_id );
 
-#if LIBAVCODEC_VERSION_MAJOR >= 53
+#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(122<<8)+0)
        // Process properties as AVOptions on the AVCodec
        if ( codec && codec->priv_class )
        {
@@ -950,7 +950,7 @@ static int open_video( mlt_properties properties, AVFormatContext *oc, AVStream
        else
                codec = avcodec_find_encoder( video_enc->codec_id );
 
-#if LIBAVCODEC_VERSION_MAJOR >= 53
+#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(122<<8)+0)
        // Process properties as AVOptions on the AVCodec
        if ( codec && codec->priv_class )
        {
@@ -1331,14 +1331,14 @@ static void *consumer_thread( void *arg )
                {
                        mlt_properties p = mlt_properties_load( fpre );
                        apply_properties( oc, p, AV_OPT_FLAG_ENCODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR >= 53
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(110<<8)+0)
                        if ( oc->oformat && oc->oformat->priv_class && oc->priv_data )
                                apply_properties( oc->priv_data, p, AV_OPT_FLAG_ENCODING_PARAM );
 #endif
                        mlt_properties_close( p );
                }
                apply_properties( oc, properties, AV_OPT_FLAG_ENCODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR >= 53
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(110<<8)+0)
                if ( oc->oformat && oc->oformat->priv_class && oc->priv_data )
                        apply_properties( oc->priv_data, properties, AV_OPT_FLAG_ENCODING_PARAM );
 #endif
index 55c5bdc2eea91326dc7e47c08d36f3dbd25217b1..6895b55bb681f7bbaeb5eef1ca2e5b20fe07f5e1 100644 (file)
@@ -851,7 +851,7 @@ static int producer_open( producer_avformat self, mlt_profile profile, const cha
        if ( !error && self->video_format )
        {
                apply_properties( self->video_format, properties, AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR >= 53
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(110<<8)+0)
                if ( self->video_format->iformat && self->video_format->iformat->priv_class && self->video_format->priv_data )
                        apply_properties( self->video_format->priv_data, properties, AV_OPT_FLAG_DECODING_PARAM );
 #endif
@@ -905,6 +905,10 @@ static int producer_open( producer_avformat self, mlt_profile profile, const cha
 #else
                                                av_open_input_file( &self->audio_format, filename, NULL, 0, NULL );
                                                apply_properties( self->audio_format, properties, AV_OPT_FLAG_DECODING_PARAM );
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(110<<8)+0)
+                        if ( self->audio_format->iformat && self->audio_format->iformat->priv_class && self->audio_format->priv_data )
+                            apply_properties( self->audio_format->priv_data, properties, AV_OPT_FLAG_DECODING_PARAM );
+#endif
                                                av_find_stream_info( self->audio_format );
 #endif
                                        }
@@ -1874,7 +1878,7 @@ static int video_codec_init( producer_avformat self, int index, mlt_properties p
 
                // Process properties as AVOptions
                apply_properties( codec_context, properties, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVCODEC_VERSION_MAJOR >= 53
+#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(122<<8)+0)
                if ( codec->priv_class && codec_context->priv_data )
                        apply_properties( codec_context->priv_data, properties, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
 #endif
@@ -2524,7 +2528,7 @@ static int audio_codec_init( producer_avformat self, int index, mlt_properties p
 
                // Process properties as AVOptions
                apply_properties( codec_context, properties, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVCODEC_VERSION_MAJOR >= 53
+#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(122<<8)+0)
                if ( codec && codec->priv_class && codec_context->priv_data )
                        apply_properties( codec_context->priv_data, properties, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
 #endif