Commit 41413189 authored by Antoine Cellerier's avatar Antoine Cellerier

misc/vlm.c : export some p_input variables (state, position, time, length,...

 misc/vlm.c : export some p_input variables (state, position, time, length, rate, title, chapter and seekable) when using the vlm "show (media)" command.
parent 5ec1e695
...@@ -1658,16 +1658,32 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, ...@@ -1658,16 +1658,32 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media,
{ {
vlm_media_instance_t *p_instance = media->instance[i]; vlm_media_instance_t *p_instance = media->instance[i];
vlc_value_t val; vlc_value_t val;
vlm_message_t *msg_instance;
char *psz_tmp;
if( !p_instance->p_input ) val.i_int = END_S; if( !p_instance->p_input ) val.i_int = END_S;
else var_Get( p_instance->p_input, "state", &val ); else var_Get( p_instance->p_input, "state", &val );
vlm_MessageAdd( msg_child, msg_instance = vlm_MessageNew( p_instance->psz_name ?
vlm_MessageNew( p_instance->psz_name ? p_instance->psz_name : "default", NULL );
p_instance->psz_name : "default", vlm_MessageAdd( msg_instance, vlm_MessageNew( "state",
val.i_int == PLAYING_S ? "playing" : val.i_int == PLAYING_S ? "playing" :
val.i_int == PAUSE_S ? "paused" : val.i_int == PAUSE_S ? "paused" :
"stopped" ) ); "stopped" ) );
#define APPEND_INPUT_INFO( a, format, type ) \
asprintf( &psz_tmp, format, \
var_Get ## type( p_instance->p_input, a ) ); \
vlm_MessageAdd( msg_instance, vlm_MessageNew( a, psz_tmp ) ); \
free( psz_tmp );
APPEND_INPUT_INFO( "position", "%f", Float );
APPEND_INPUT_INFO( "time", "%d", Integer );
APPEND_INPUT_INFO( "length", "%d", Integer );
APPEND_INPUT_INFO( "rate", "%d", Integer );
APPEND_INPUT_INFO( "title", "%d", Integer );
APPEND_INPUT_INFO( "chapter", "%d", Integer );
APPEND_INPUT_INFO( "seekable", "%d", Bool );
#undef APPEND_INPUT_INFO
vlm_MessageAdd( msg_child, msg_instance );
} }
return msg; return msg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment