]> git.sesse.net Git - mlt/commitdiff
Use newer av_get_sample_fmt_name() if available.
authorDan Dennedy <dan@dennedy.org>
Thu, 21 Apr 2011 21:34:47 +0000 (14:34 -0700)
committerDan Dennedy <dan@dennedy.org>
Thu, 21 Apr 2011 21:34:47 +0000 (14:34 -0700)
src/modules/avformat/producer_avformat.c

index ba85233d3f75bbed2f665e2e73134259fa7fe468..fdfe51b625df56d263915cb2d72e06ea14ee517d 100644 (file)
@@ -328,7 +328,10 @@ static mlt_properties find_default_streams( mlt_properties meta_media, AVFormatC
                                if ( *audio_index < 0 )
                                        *audio_index = i;
                                mlt_properties_set( meta_media, key, "audio" );
-#if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
+#if LIBAVCODEC_VERSION_MAJOR > 52
+                               snprintf( key, sizeof(key), "meta.media.%d.codec.sample_fmt", i );
+                               mlt_properties_set( meta_media, key, av_get_sample_fmt_name( codec_context->sample_fmt ) );
+#elif (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
                                snprintf( key, sizeof(key), "meta.media.%d.codec.sample_fmt", i );
                                mlt_properties_set( meta_media, key, avcodec_get_sample_fmt_name( codec_context->sample_fmt ) );
 #endif