Clean up and border preservation
[melted] / src / modules / inigo / producer_inigo.c
index 893c01e..1e6b4bb 100644 (file)
@@ -69,47 +69,7 @@ static void track_service( mlt_field field, void *service, mlt_destructor destru
 
 static mlt_producer create_producer( mlt_field field, char *file )
 {
-       mlt_producer result = NULL;
-
-       // 1st Line preferences
-       if ( strstr( file, ".inigo" ) )
-               result = mlt_factory_producer( "inigo_file", file );
-       else if ( strstr( file, ".mpg" ) )
-               result = mlt_factory_producer( "mcmpeg", file );
-       else if ( strstr( file, ".mpeg" ) )
-               result = mlt_factory_producer( "mcmpeg", file );
-       else if ( strstr( file, ".dv" ) )
-               result = mlt_factory_producer( "mcdv", file );
-       else if ( strstr( file, ".dif" ) )
-               result = mlt_factory_producer( "mcdv", file );
-       else if ( strstr( file, ".jpg" ) )
-               result = mlt_factory_producer( "pixbuf", file );
-       else if ( strstr( file, ".JPG" ) )
-               result = mlt_factory_producer( "pixbuf", file );
-       else if ( strstr( file, ".jpeg" ) )
-               result = mlt_factory_producer( "pixbuf", file );
-       else if ( strstr( file, ".png" ) )
-               result = mlt_factory_producer( "pixbuf", file );
-       else if ( strstr( file, ".txt" ) )
-               result = mlt_factory_producer( "pango", file );
-       else if ( strstr( file, ".westley" ) )
-               result = mlt_factory_producer( "westley", file );
-       else if ( strstr( file, ".ogg" ) )
-               result = mlt_factory_producer( "vorbis", file );
-
-       // 2nd Line fallbacks
-       if ( result == NULL && strstr( file, ".dv" ) )
-               result = mlt_factory_producer( "libdv", file );
-       else if ( result == NULL && strstr( file, ".dif" ) )
-               result = mlt_factory_producer( "libdv", file );
-
-       // 3rd line fallbacks 
-       if ( result == NULL )
-               result = mlt_factory_producer( "avformat", file );
-
-       // 4th line fallbacks 
-       if ( result == NULL )
-               result = mlt_factory_producer( "ffmpeg", file );
+       mlt_producer result = mlt_factory_producer( "fezzik", file );
 
        if ( result != NULL )
                track_service( field, result, ( mlt_destructor )mlt_producer_close );
@@ -198,7 +158,10 @@ mlt_producer producer_inigo_init( char **argv )
                        producer = NULL;
                        mlt_playlist_blank( playlist, atof( argv[ ++ i ] ) );
                }
-               else if ( !strcmp( argv[ i ], "-track" ) )
+               else if ( !strcmp( argv[ i ], "-track" ) ||
+                                 !strcmp( argv[ i ], "-hide-track" ) ||
+                                 !strcmp( argv[ i ], "-hide-video" ) ||
+                                 !strcmp( argv[ i ], "-hide-audio" ) )
                {
                        if ( producer != NULL )
                                mlt_playlist_append( playlist, producer );
@@ -206,8 +169,18 @@ mlt_producer producer_inigo_init( char **argv )
                        mlt_multitrack_connect( multitrack, mlt_playlist_producer( playlist ), track ++ );
                        track_service( field, playlist, ( mlt_destructor )mlt_playlist_close );
                        playlist = mlt_playlist_init( );
+                       if ( playlist != NULL )
+                       {
+                               properties = mlt_playlist_properties( playlist );
+                               if ( !strcmp( argv[ i ], "-hide-track" ) )
+                                       mlt_properties_set_int( properties, "hide", 3 );
+                               else if ( !strcmp( argv[ i ], "-hide-video" ) )
+                                       mlt_properties_set_int( properties, "hide", 1 );
+                               else if ( !strcmp( argv[ i ], "-hide-audio" ) )
+                                       mlt_properties_set_int( properties, "hide", 2 );
+                       }
                }
-               else if ( strstr( argv[ i ], "=" ) )
+               else if ( strchr( argv[ i ], '=' ) )
                {
                        mlt_properties_parse( properties, argv[ i ] );
                }
@@ -259,4 +232,3 @@ mlt_producer producer_inigo_init( char **argv )
 
        return mlt_tractor_producer( tractor );
 }
-