]> git.sesse.net Git - mlt/blobdiff - src/modules/core/producer_loader.c
Make the arg to avcolor_space filter a pointer.
[mlt] / src / modules / core / producer_loader.c
index ccf2e4469fb337fd870ba1b4b1dd09eafc6d5511..017197ca3327f69ac505adaa227e19390bc19072 100644 (file)
@@ -162,6 +162,7 @@ static mlt_producer create_producer( mlt_profile profile, char *file )
 
 static void create_filter( mlt_profile profile, mlt_producer producer, char *effect, int *created )
 {
+       mlt_filter filter;
        char *id = strdup( effect );
        char *arg = strchr( id, ':' );
        if ( arg != NULL )
@@ -169,10 +170,15 @@ static void create_filter( mlt_profile profile, mlt_producer producer, char *eff
 
        // 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_PRODUCER_PROPERTIES( producer ), "meta.media.width" );
-
-       mlt_filter filter = mlt_factory_filter( profile, id, arg );
-       if ( filter != NULL )
+       {
+               int width = mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( producer ), "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_producer_attach( producer, filter );