From: Antoine Cellerier Date: Tue, 10 May 2005 13:02:11 +0000 (+0000) Subject: * show number of broadcast and vod media items within show command X-Git-Tag: 0.8.2~275 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6d7e63dddedfa88cc51f1c24821a65e4ff71f0a3;p=vlc * show number of broadcast and vod media items within show command When we end the feature freeze, we'll have to complete the show command to show (for example) the number of clients connected --- diff --git a/src/misc/vlm.c b/src/misc/vlm.c index 1f27a74085..260602011f 100644 --- a/src/misc/vlm.c +++ b/src/misc/vlm.c @@ -1743,9 +1743,22 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, int i, j; vlm_message_t *msg; vlm_message_t *msg_child; + int i_vod = 0, i_broadcast = 0; + char *psz_count; + + for( i = 0; i < vlm->i_media; i++ ) + { + if( vlm->media[i]->i_type == VOD_TYPE ) + i_vod ++; + else + i_broadcast ++; + } + + asprintf( &psz_count, "( %d broadcast - %d vod )", i_broadcast, i_vod); msg = vlm_MessageNew( "show", NULL ); - msg_child = vlm_MessageAdd( msg, vlm_MessageNew( "media", NULL ) ); + msg_child = vlm_MessageAdd( msg, vlm_MessageNew( "media", psz_count ) ); + free( psz_count ); for( i = 0; i < vlm->i_media; i++ ) {