X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2Ffilter_swscale.c;h=9a47076962f7894930b15131c885a5bbe6777fbf;hb=c24a9369d821bc07e44c2d6b046d4ceb404e7541;hp=8e88f7c623df199df972d45837415bc52b298fd1;hpb=c27fb53aea55a3ef8c52726e4f7f03b7ac768769;p=mlt diff --git a/src/modules/avformat/filter_swscale.c b/src/modules/avformat/filter_swscale.c index 8e88f7c6..9a470769 100644 --- a/src/modules/avformat/filter_swscale.c +++ b/src/modules/avformat/filter_swscale.c @@ -31,11 +31,6 @@ #include #include -#if LIBAVUTIL_VERSION_INT < (50<<16) -#define PIX_FMT_RGB32 PIX_FMT_RGBA32 -#define PIX_FMT_YUYV422 PIX_FMT_YUV422 -#endif - static inline int convert_mlt_to_av_cs( mlt_image_format format ) { int value = 0; @@ -191,13 +186,15 @@ mlt_filter filter_swscale_init( mlt_profile profile, void *arg ) // Test to see if swscale accepts the arg as resolution if ( arg ) { - int width = (int) arg; - struct SwsContext *context = sws_getContext( width, width, PIX_FMT_RGB32, 64, 64, PIX_FMT_RGB32, SWS_BILINEAR, NULL, NULL, NULL); - if ( context ) - sws_freeContext( context ); - else - return NULL; - } + int *width = (int*) arg; + if ( *width > 0 ) + { + struct SwsContext *context = sws_getContext( *width, *width, PIX_FMT_RGB32, 64, 64, PIX_FMT_RGB32, SWS_BILINEAR, NULL, NULL, NULL); + if ( context ) + sws_freeContext( context ); + else + return NULL; + } } // Create a new scaler mlt_filter filter = mlt_factory_filter( profile, "rescale", NULL );