From: Maksym Veremeyenko Date: Wed, 27 Jun 2012 12:19:09 +0000 (+0300) Subject: extend USTA output with current clip start time and playlist duration X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=50494c72c7b8b700cf4df4c1f25ae1b5323e4df2;p=melted extend USTA output with current clip start time and playlist duration --- diff --git a/src/melted/melted_unit.c b/src/melted/melted_unit.c index 3f09def..3da08a7 100644 --- a/src/melted/melted_unit.c +++ b/src/melted/melted_unit.c @@ -578,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" ); diff --git a/src/mvcp/mvcp_status.c b/src/mvcp/mvcp_status.c index 209290f..9c73151 100644 --- a/src/mvcp/mvcp_status.c +++ b/src/mvcp/mvcp_status.c @@ -34,7 +34,8 @@ void mvcp_status_parse( mvcp_status status, char *text ) { mvcp_tokeniser tokeniser = mvcp_tokeniser_init( ); - if ( mvcp_tokeniser_parse_new( tokeniser, text, " " ) == 17 ) + int r = mvcp_tokeniser_parse_new( tokeniser, text, " " ); + if ( 19 == r || 17 == r ) { status->unit = atoi( mvcp_tokeniser_get_string( tokeniser, 0 ) ); strncpy( status->clip, mvcp_util_strip( mvcp_tokeniser_get_string( tokeniser, 2 ), '\"' ), sizeof( status->clip ) ); @@ -53,6 +54,11 @@ void mvcp_status_parse( mvcp_status status, char *text ) status->seek_flag = atoi( mvcp_tokeniser_get_string( tokeniser, 14 ) ); status->generation = atoi( mvcp_tokeniser_get_string( tokeniser, 15 ) ); status->clip_index = atoi( mvcp_tokeniser_get_string( tokeniser, 16 ) ); + if ( 19 == r ) + { + status->start = atoi( mvcp_tokeniser_get_string( tokeniser, 17 ) ); + status->dur = atoi( mvcp_tokeniser_get_string( tokeniser, 18 ) ); + }; if ( !strcmp( mvcp_tokeniser_get_string( tokeniser, 1 ), "unknown" ) ) status->status = unit_unknown; @@ -121,7 +127,7 @@ char *mvcp_status_serialise( mvcp_status status, char *text, int length ) break; } - snprintf( text, length, "%d %s \"%s\" %d %d %.2f %d %d %d \"%s\" %d %d %d %d %d %d %d\r\n", + snprintf( text, length, "%d %s \"%s\" %d %d %.2f %d %d %d \"%s\" %d %d %d %d %d %d %d %d %d\r\n", status->unit, status_string, status->clip, @@ -138,7 +144,9 @@ char *mvcp_status_serialise( mvcp_status status, char *text, int length ) status->tail_length, status->seek_flag, status->generation, - status->clip_index ); + status->clip_index, + status->start, + status->dur ); return text; } diff --git a/src/mvcp/mvcp_status.h b/src/mvcp/mvcp_status.h index c629473..c9128f7 100644 --- a/src/mvcp/mvcp_status.h +++ b/src/mvcp/mvcp_status.h @@ -67,6 +67,8 @@ typedef struct int generation; int clip_index; int dummy; + int dur; /**< duration of playlist */ + int start; /**< time head clip relative to the beginning of the playlist */ } *mvcp_status, mvcp_status_t;