+ if ( melt )
+ {
+ // If the producer changed the profile then do not try to guess it.
+ if ( profile->width != backup_profile->width ||
+ profile->height != backup_profile->height ||
+ profile->sample_aspect_num != backup_profile->sample_aspect_num ||
+ profile->sample_aspect_den != backup_profile->sample_aspect_den )
+ {
+ if ( is_profile_explicit )
+ {
+ // We need to use the 'consumer' producer.
+ mlt_producer_close( melt );
+ mlt_profile_close( profile );
+ profile = backup_profile;
+ backup_profile = NULL;
+ if ( profile->description )
+ free( profile->description );
+ // This is a hack to signal create_producer() in producer_melt.c.
+ profile->description = strdup( "consumer:" );
+ melt = mlt_factory_producer( profile, "melt", &argv[ 1 ] );
+ }
+ }
+ else if ( ! is_profile_explicit )
+ {
+ guess_profile( melt, profile );
+ }
+
+ // Reload the consumer with the fully qualified profile
+ for ( i = 1; i < argc; i ++ )
+ {
+ if ( !strcmp( argv[ i ], "-consumer" ) )
+ {
+ if ( consumer )
+ mlt_consumer_close( consumer );
+ consumer = create_consumer( profile, argv[ ++ i ] );
+ if ( consumer )
+ {
+ mlt_properties properties = MLT_CONSUMER_PROPERTIES( consumer );
+ while ( argv[ i + 1 ] != NULL && strstr( argv[ i + 1 ], "=" ) )
+ mlt_properties_parse( properties, argv[ ++ i ] );
+ }
+ }
+ }
+
+ // If we have no consumer, default to sdl
+ if ( store == NULL && consumer == NULL )
+ consumer = create_consumer( profile, NULL );
+ }
+