bump to version 0.3.8
[melted] / src / modules / avformat / producer_avformat.c
index b5fd38a..1ce2dca 100644 (file)
@@ -22,6 +22,7 @@
 // MLT Header files
 #include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
+#include <framework/mlt_profile.h>
 
 // ffmpeg Header files
 #include <avformat.h>
 #include <pthread.h>
 #include <math.h>
 
+#if LIBAVUTIL_VERSION_INT < (50<<16)
+#define PIX_FMT_YUYV422 PIX_FMT_YUV422
+#endif
+
 void avformat_lock( );
 void avformat_unlock( );
 
@@ -191,8 +196,10 @@ static mlt_properties find_default_streams( mlt_properties meta_media, AVFormatC
 //             mlt_properties_set_double( meta_media, key, av_q2d( context->streams[ i ]->time_base ) );
                snprintf( key, sizeof(key), "meta.media.%d.codec.name", i );
                mlt_properties_set( meta_media, key, codec->name );
+#if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(55<<8)+0))
                snprintf( key, sizeof(key), "meta.media.%d.codec.long_name", i );
                mlt_properties_set( meta_media, key, codec->long_name );
+#endif
                snprintf( key, sizeof(key), "meta.media.%d.codec.bit_rate", i );
                mlt_properties_set_int( meta_media, key, codec_context->bit_rate );
 //             snprintf( key, sizeof(key), "meta.media.%d.codec.time_base", i );
@@ -627,8 +634,8 @@ static inline void convert_image( AVFrame *frame, uint8_t *buffer, int pix_fmt,
        else
        {
                AVPicture output;
-               avpicture_fill( &output, buffer, PIX_FMT_YUV422, width, height );
-               img_convert( &output, PIX_FMT_YUV422, (AVPicture *)frame, pix_fmt, width, height );
+               avpicture_fill( &output, buffer, PIX_FMT_YUYV422, width, height );
+               img_convert( &output, PIX_FMT_YUYV422, (AVPicture *)frame, pix_fmt, width, height );
        }
 #endif
 }