+ }
+
+ // Check if the producer changed the profile - xml does this.
+ if ( result && backup_profile->is_explicit && (
+ 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 ) )
+ {
+ // Restore the original profile attributes.
+ profile->display_aspect_den = backup_profile->display_aspect_den;
+ profile->display_aspect_num = backup_profile->display_aspect_num;
+ profile->frame_rate_den = backup_profile->frame_rate_den;
+ profile->frame_rate_num = backup_profile->frame_rate_num;
+ profile->height = backup_profile->height;
+ profile->progressive = backup_profile->progressive;
+ profile->sample_aspect_den = backup_profile->sample_aspect_den;
+ profile->sample_aspect_num = backup_profile->sample_aspect_num;
+ profile->width = backup_profile->width;
+
+ // Use the 'consumer' producer.
+ mlt_producer_close( result );
+ result = mlt_factory_producer( profile, "consumer", file );