extend USTA output with current clip start time and playlist duration
[melted] / src / melted / melted_unit.c
index 66dfd9c..3da08a7 100644 (file)
@@ -55,6 +55,7 @@ melted_unit melted_unit_init( int index, char *constructor )
 {
        melted_unit this = NULL;
        mlt_consumer consumer = NULL;
+       mlt_profile profile = mlt_profile_init( NULL );
 
        char *id = strdup( constructor );
        char *arg = strchr( id, ':' );
@@ -62,7 +63,8 @@ melted_unit melted_unit_init( int index, char *constructor )
        if ( arg != NULL )
                *arg ++ = '\0';
 
-       consumer = mlt_factory_consumer( NULL, id, arg );
+       profile->is_explicit = 1;
+       consumer = mlt_factory_consumer( profile, id, arg );
 
        if ( consumer != NULL )
        {
@@ -576,6 +578,8 @@ int melted_unit_get_status( melted_unit unit, mvcp_status status )
                        status->tail_length = mlt_producer_get_length( clip );
                        status->clip_index = mlt_playlist_current_clip( playlist );
                        status->seek_flag = 1;
+                       status->dur = mlt_producer_get_length( producer );
+                       status->start = info.start;
                }
 
                status->generation = mlt_properties_get_int( properties, "generation" );