]> git.sesse.net Git - mlt/commitdiff
convert all SAMPLE_FMT_16 to AV_SAMPLE_FMT_16
authorDan Dennedy <dan@dennedy.org>
Sat, 28 Jan 2012 22:47:47 +0000 (14:47 -0800)
committerDan Dennedy <dan@dennedy.org>
Sat, 28 Jan 2012 22:47:47 +0000 (14:47 -0800)
src/modules/avformat/filter_avresample.c
src/modules/avformat/producer_avformat.c

index 340d22512350b6e6f905268ff1fddc7c415d0b49..94d677f17682414cce23f3cbc32ed1feb0f4ae89 100644 (file)
@@ -28,6 +28,9 @@
 
 // ffmpeg Header files
 #include <libavformat/avformat.h>
+#if LIBAVUTIL_VERSION_INT >= ((50<<16)+(38<<8)+0)
+#include <libavutil/samplefmt.h>
+#endif
 
 /** Get the audio.
 */
@@ -79,7 +82,7 @@ static int resample_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
                        // Create the resampler
 #if (LIBAVCODEC_VERSION_INT >= ((52<<16)+(15<<8)+0))
                        resample = av_audio_resample_init( *channels, *channels, output_rate, *frequency,
-                               SAMPLE_FMT_S16, SAMPLE_FMT_S16, 16, 10, 0, 0.8 );
+                               AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16, 16, 10, 0, 0.8 );
 #else
                        resample = audio_resample_init( *channels, *channels, output_rate, *frequency );
 #endif
index d5d87749e8389f0048c0a375a2fdd7fd6fe16cd1..8476f90f59cc83c75e619c003eaa9cc178dcd92b 100644 (file)
@@ -34,7 +34,7 @@
 #ifdef SWSCALE
 #  include <libswscale/swscale.h>
 #endif
-#if LIBAVCODEC_VERSION_MAJOR >= 53
+#if LIBAVUTIL_VERSION_INT >= ((50<<16)+(38<<8)+0)
 #include <libavutil/samplefmt.h>
 #elif (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
 const char *avcodec_get_sample_fmt_name(int sample_fmt);
@@ -2296,7 +2296,7 @@ static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
                                self->audio_resample[ index ] = av_audio_resample_init(
                                        self->audio_index == INT_MAX ? codec_context->channels : *channels,
                                        codec_context->channels, *frequency, codec_context->sample_rate,
-                                       SAMPLE_FMT_S16, codec_context->sample_fmt, 16, 10, 0, 0.8 );
+                                       AV_SAMPLE_FMT_S16, codec_context->sample_fmt, 16, 10, 0, 0.8 );
 #else
                                self->audio_resample[ index ] = audio_resample_init(
                                        self->audio_index == INT_MAX ? codec_context->channels : *channels,
@@ -2399,8 +2399,8 @@ static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
                        index = self->audio_index;
                        *channels = self->audio_codec[ index ]->channels;
                        *frequency = self->audio_codec[ index ]->sample_rate;
-                       *format = self->audio_codec[ index ]->sample_fmt == SAMPLE_FMT_S32 ? mlt_audio_s32le
-                               : self->audio_codec[ index ]->sample_fmt == SAMPLE_FMT_FLT ? mlt_audio_f32le
+                       *format = self->audio_codec[ index ]->sample_fmt == AV_SAMPLE_FMT_S32 ? mlt_audio_s32le
+                               : self->audio_codec[ index ]->sample_fmt == AV_SAMPLE_FMT_FLT ? mlt_audio_f32le
                                : mlt_audio_s16;
                        sizeof_sample = sample_bytes( self->audio_codec[ index ] );
                }
@@ -2410,8 +2410,8 @@ static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
                        for ( index = 0; index < index_max; index++ )
                                if ( self->audio_codec[ index ] && !self->audio_resample[ index ] )
                                {
-                                       *format = self->audio_codec[ index ]->sample_fmt == SAMPLE_FMT_S32 ? mlt_audio_s32le
-                                               : self->audio_codec[ index ]->sample_fmt == SAMPLE_FMT_FLT ? mlt_audio_f32le
+                                       *format = self->audio_codec[ index ]->sample_fmt == AV_SAMPLE_FMT_S32 ? mlt_audio_s32le
+                                               : self->audio_codec[ index ]->sample_fmt == AV_SAMPLE_FMT_FLT ? mlt_audio_f32le
                                                : mlt_audio_s16;
                                        sizeof_sample = sample_bytes( self->audio_codec[ index ] );
                                        break;