X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Ffezzik%2Fproducer_fezzik.c;h=816c1bd70a2210f44a904f5acdf6049bec6fb0db;hb=bb52b9f3ce843820aca77ca7bc18adf1dcd61122;hp=f5350c82aac18339d9b6df9ad5c6768fd1ce1137;hpb=d33f444d4ef4c7bc4074d07a49eca0ab7d108394;p=melted diff --git a/src/modules/fezzik/producer_fezzik.c b/src/modules/fezzik/producer_fezzik.c index f5350c8..816c1bd 100644 --- a/src/modules/fezzik/producer_fezzik.c +++ b/src/modules/fezzik/producer_fezzik.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -73,7 +74,7 @@ static mlt_producer create_producer( mlt_profile profile, char *file ) if ( dictionary == NULL ) { char temp[ 1024 ]; - sprintf( temp, "%s/fezzik.dict", mlt_factory_prefix( ) ); + sprintf( temp, "%s/fezzik.dict", mlt_environment( "MLT_DATA" ) ); dictionary = mlt_properties_load( temp ); mlt_factory_register_for_clean_up( dictionary, ( mlt_destructor )mlt_properties_close ); } @@ -105,6 +106,13 @@ static mlt_producer create_producer( mlt_profile profile, char *file ) static void create_filter( mlt_profile profile, mlt_producer producer, char *effect, int *created ) { + // The swscale filter can not handle images with a width > 2048 and the + // sdl_image producer does not scale on its own + if ( strncmp( effect, "swscale", 7 ) == 0 && + mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( producer ), "_real_width" ) > 2048 && + strcmp( mlt_properties_get( MLT_PRODUCER_PROPERTIES( producer ), "mlt_service" ), "sdl_image" ) == 0 ) + return; + char *id = strdup( effect ); char *arg = strchr( id, ':' ); if ( arg != NULL ) @@ -132,7 +140,7 @@ static void attach_normalisers( mlt_profile profile, mlt_producer producer ) if ( normalisers == NULL ) { char temp[ 1024 ]; - sprintf( temp, "%s/fezzik.ini", mlt_factory_prefix( ) ); + sprintf( temp, "%s/fezzik.ini", mlt_environment( "MLT_DATA" ) ); normalisers = mlt_properties_load( temp ); mlt_factory_register_for_clean_up( normalisers, ( mlt_destructor )mlt_properties_close ); } @@ -165,7 +173,9 @@ mlt_producer producer_fezzik_init( mlt_profile profile, mlt_service_type type, c properties = MLT_PRODUCER_PROPERTIES( producer ); // Attach filters if we have a producer and it isn't already westley'd :-) - if ( producer != NULL && mlt_properties_get( properties, "westley" ) == NULL && mlt_properties_get( properties, "_westley" ) == NULL ) + if ( producer != NULL && mlt_properties_get( properties, "westley" ) == NULL && \ + mlt_properties_get( properties, "_westley" ) == NULL && \ + mlt_properties_get( properties, "fezzik_normalised" ) == NULL ) attach_normalisers( profile, producer ); // Now make sure we don't lose our identity