#define PIX_FMT_YUYV422 PIX_FMT_YUV422
#endif
+#if LIBAVCODEC_VERSION_MAJOR > 52
+#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
+#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
+#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
+#endif
+
#define MAX_AUDIO_STREAMS (8)
#define AUDIO_ENCODE_BUFFER_SIZE (48000 * 2 * MAX_AUDIO_STREAMS)
#define AUDIO_BUFFER_SIZE (1024 * 42)
if ( thread_count == 0 && getenv( "MLT_AVFORMAT_THREADS" ) )
thread_count = atoi( getenv( "MLT_AVFORMAT_THREADS" ) );
if ( thread_count > 1 )
- avcodec_thread_init( c, thread_count );
+ c->thread_count = thread_count;
#endif
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
c->channels = channels;
if ( mlt_properties_get( properties, "alang" ) != NULL )
+#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(43<<8)+0)
+ av_metadata_set2( &oc->metadata, "language", mlt_properties_get( properties, "alang" ), 0 );
+#else
+
strncpy( st->language, mlt_properties_get( properties, "alang" ), sizeof( st->language ) );
+#endif
}
else
{
if ( thread_count == 0 && getenv( "MLT_AVFORMAT_THREADS" ) )
thread_count = atoi( getenv( "MLT_AVFORMAT_THREADS" ) );
if ( thread_count > 1 )
- avcodec_thread_init( c, thread_count );
+ c->thread_count = thread_count;
// Process properties as AVOptions
char *vpre = mlt_properties_get( properties, "vpre" );
#define PIX_FMT_YUYV422 PIX_FMT_YUV422
#endif
+#if LIBAVCODEC_VERSION_MAJOR > 52
+#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
+#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
+#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
+#endif
+
#define POSITION_INITIAL (-2)
#define POSITION_INVALID (-1)
if ( thread_count == 0 && getenv( "MLT_AVFORMAT_THREADS" ) )
thread_count = atoi( getenv( "MLT_AVFORMAT_THREADS" ) );
if ( thread_count > 1 )
- {
- avcodec_thread_init( codec_context, thread_count );
codec_context->thread_count = thread_count;
- }
// If we don't have a codec and we can't initialise it, we can't do much more...
avformat_lock( );