X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fconsumer_multi.c;h=1cf6593a17ec45754ca5a60991d52d8f139f2fe2;hb=7ae60e5c2cdbcfe17255694521a0ac941552b258;hp=1781746a419fec89f9c0b2d5f6b13eebbbb00576;hpb=5fea25f248d32e1c24c769b019c22cdb8da4f5bc;p=mlt diff --git a/src/modules/core/consumer_multi.c b/src/modules/core/consumer_multi.c index 1781746a..1cf6593a 100644 --- a/src/modules/core/consumer_multi.c +++ b/src/modules/core/consumer_multi.c @@ -83,15 +83,21 @@ static void create_filter( mlt_profile profile, mlt_service service, char *effec if ( arg != NULL ) *arg ++ = '\0'; - // The swscale and avcolor_space filters require resolution as arg to test compatibility - if ( strncmp( effect, "swscale", 7 ) == 0 || strncmp( effect, "avcolo", 6 ) == 0 ) - arg = (char*) mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "meta.media.width" ); - // We cannot use GLSL-based filters here. if ( strncmp( effect, "movit.", 6 ) && strncmp( effect, "glsl.", 5 ) ) { - mlt_filter filter = mlt_factory_filter( profile, id, arg ); - if ( filter != NULL ) + mlt_filter filter; + // The swscale and avcolor_space filters require resolution as arg to test compatibility + if ( strncmp( effect, "swscale", 7 ) == 0 || strncmp( effect, "avcolo", 6 ) == 0 ) + { + int width = mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "meta.media.width" ); + filter = mlt_factory_filter( profile, id, &width ); + } + else + { + filter = mlt_factory_filter( profile, id, arg ); + } + if ( filter ) { mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_loader", 1 ); mlt_service_attach( service, filter );