On Sun, May 15, 2011 at 9:14 AM, Simon A. Eugster <[email protected]> wrote:
> I'm using libav, is this maybe the reason for this compiler error?
> Would like to compile MLT in order to compile kdenlive 0.8 ;)
>
> make[2]: Entering directory `/data/cworkspace/mlt/src/modules/avformat'
> cc -I../.. -Wall -DPIC   -O2 -pipe -fomit-frame-pointer -ffast-math
> -DUSE_MMX -DUSE_SSE -DUSE_SSE2 -g -D_FILE_OFFSET_BITS=64
> -D_LARGEFILE_SOURCE -DARCH_X86_64 -fPIC -pthread
> -DAVDATADIR=\"/usr/share/ffmpeg/\"    -DFILTERS -DVDPAU `pkg-config
> --cflags x11` -DCODECS -DSWSCALE -DAVDEVICE   -c -o producer_avformat.o
> producer_avformat.c
> producer_avformat.c: In function ‘reopen_video’:
> producer_avformat.c:812:65: error: ‘struct AVInputFormat’ has no member
> named ‘priv_class’
> producer_avformat.c: In function ‘producer_get_image’:
> producer_avformat.c:1083:59: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> producer_avformat.c:1488:37: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> producer_avformat.c: In function ‘producer_set_up_video’:
> producer_avformat.c:1771:45: error: ‘struct AVInputFormat’ has no member
> named ‘priv_class’

Works for me using ffmpeg head. Let me know if the following patch
works or supply a better one.

-- 
+-DRD-+
diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index a72169d..4086de7 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -518,7 +518,7 @@ static int open_audio( mlt_properties properties, AVFormatContext *oc, AVStream

 #if LIBAVCODEC_VERSION_MAJOR > 52
    // Process properties as AVOptions on the AVCodec
-	if ( codec && codec->priv_class && c->priv_data )
+	if ( codec && c->priv_data )
    {
        char *apre = mlt_properties_get( properties, "apre" );
        if ( apre )
@@ -889,7 +889,7 @@ static int open_video( mlt_properties properties, AVFormatContext *oc, AVStream

 #if LIBAVCODEC_VERSION_MAJOR > 52
    // Process properties as AVOptions on the AVCodec
-	if ( codec && codec->priv_class && video_enc->priv_data )
+	if ( codec && video_enc->priv_data )
    {
        char *vpre = mlt_properties_get( properties, "vpre" );
        if ( vpre )
@@ -1210,14 +1210,14 @@ static void *consumer_thread( void *arg )
            mlt_properties p = mlt_properties_load( fpre );
            apply_properties( oc, p, AV_OPT_FLAG_ENCODING_PARAM, 1 );
 #if LIBAVFORMAT_VERSION_MAJOR > 52
-			if ( oc->oformat && oc->oformat->priv_class && oc->priv_data )
+			if ( oc->oformat && oc->priv_data )
                apply_properties( oc->priv_data, p, AV_OPT_FLAG_ENCODING_PARAM, 1 );
 #endif
            mlt_properties_close( p );
        }
        apply_properties( oc, properties, AV_OPT_FLAG_ENCODING_PARAM, 0 );
 #if LIBAVFORMAT_VERSION_MAJOR > 52
-		if ( oc->oformat && oc->oformat->priv_class && oc->priv_data )
+		if ( oc->oformat && oc->priv_data )
            apply_properties( oc->priv_data, properties, AV_OPT_FLAG_ENCODING_PARAM, 1 );
 #endif

diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c
index e1f88de..38e8a19 100644
--- a/src/modules/avformat/producer_avformat.c
+++ b/src/modules/avformat/producer_avformat.c
@@ -809,7 +809,7 @@ void reopen_video( producer_avformat self, mlt_producer producer, mlt_properties
    mlt_events_unblock( properties, producer );
    apply_properties( self->video_format, properties, AV_OPT_FLAG_DECODING_PARAM );
 #if LIBAVFORMAT_VERSION_MAJOR > 52
-	if ( self->video_format->iformat && self->video_format->iformat->priv_class && self->video_format->priv_data )
+	if ( self->video_format->iformat && self->video_format->priv_data )
        apply_properties( self->video_format->priv_data, properties, AV_OPT_FLAG_DECODING_PARAM );
 #endif

@@ -1631,7 +1631,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 > 52
-		if ( codec->priv_class && codec_context->priv_data )
+		if ( codec_context->priv_data )
            apply_properties( codec_context->priv_data, properties, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
 #endif

@@ -1768,7 +1768,7 @@ static void producer_set_up_video( producer_avformat self, mlt_frame frame )
        {
            apply_properties( context, properties, AV_OPT_FLAG_DECODING_PARAM );
 #if LIBAVFORMAT_VERSION_MAJOR > 52
-			if ( context->iformat && context->iformat->priv_class && context->priv_data )
+			if ( context->iformat && context->priv_data )
                apply_properties( context->priv_data, properties, AV_OPT_FLAG_DECODING_PARAM );
 #endif
        }
@@ -2265,7 +2265,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 > 52
-		if ( codec && codec->priv_class && codec_context->priv_data )
+		if ( codec && codec_context->priv_data )
            apply_properties( codec_context->priv_data, properties, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
 #endif
    }
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to