]> git.sesse.net Git - vlc/commitdiff
* show number of broadcast and vod media items within show command
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 10 May 2005 13:02:11 +0000 (13:02 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 10 May 2005 13:02:11 +0000 (13:02 +0000)
When we end the feature freeze, we'll have to complete the show command to
show (for example) the number of clients connected

src/misc/vlm.c

index 1f27a74085b1c6ce7b330b77d26cda3c337c62f4..260602011fec5a55fb3bcd32cc1a88b67094d5ca 100644 (file)
@@ -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++ )
         {