]> git.sesse.net Git - mlt/commitdiff
Restore avresample filter when build against FFmpeg.
authorDan Dennedy <dan@dennedy.org>
Fri, 22 Mar 2013 04:48:02 +0000 (21:48 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 23 Mar 2013 20:06:14 +0000 (13:06 -0700)
This provides a LGPL audio resampler, but it is using deprecated APIs.
Support for swresample or libav avresampler is another project.

src/modules/avformat/factory.c
src/modules/avformat/filter_avresample.c

index 773a80355a10165d025311c3a5a1b6eaa36ce26a..9730d3461be247242c1631f947a47a57f6c063f4 100644 (file)
@@ -131,7 +131,7 @@ static void *create_service( mlt_profile profile, mlt_service_type type, const c
                return filter_avcolour_space_init( arg );
        if ( !strcmp( id, "avdeinterlace" ) )
                return filter_avdeinterlace_init( arg );
-#if LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0)
+#if defined(FFUDIV) || (LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0))
        if ( !strcmp( id, "avresample" ) )
                return filter_avresample_init( arg );
 #endif
@@ -373,7 +373,7 @@ MLT_REPOSITORY
        MLT_REGISTER( filter_type, "avcolour_space", create_service );
        MLT_REGISTER( filter_type, "avcolor_space", create_service );
        MLT_REGISTER( filter_type, "avdeinterlace", create_service );
-#if LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0)
+#if defined(FFUDIV) || (LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0))
        MLT_REGISTER( filter_type, "avresample", create_service );
 #endif
        MLT_REGISTER( filter_type, "swscale", create_service );
index 8cc43f2545676abd1b86ec4189df55f9e3dc29fb..fecfebb2dda5e4960d95a428b3d8ed1f3f487bd7 100644 (file)
 #include <libavformat/avformat.h>
 #include <libavutil/samplefmt.h>
 
-#if LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0)
+#if defined(FFUDIV) || (LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0))
+
+#define MAX_AUDIO_FRAME_SIZE (192000) // 1 second of 48khz 32bit audio
+
 
 /** Get the audio.
 */
@@ -148,7 +151,7 @@ mlt_filter filter_avresample_init( char *arg )
        if ( filter != NULL )
        {
                // Calculate size of the buffer
-               int size = AVCODEC_MAX_AUDIO_FRAME_SIZE * sizeof( int16_t );
+               int size = MAX_AUDIO_FRAME_SIZE * sizeof( int16_t );
 
                // Allocate the buffer
                int16_t *buffer = mlt_pool_alloc( size );
@@ -170,4 +173,4 @@ mlt_filter filter_avresample_init( char *arg )
        return filter;
 }
 
-#endif // LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0)
+#endif // defined(FFUDIV) || (LIBAVCODEC_VERSION_INT < ((54<<16)+(26<<8)+0))