]> git.sesse.net Git - vlc/blobdiff - src/misc/vlm.c
Backport 13132
[vlc] / src / misc / vlm.c
index 50a994430051895b4eebd8e8d6f551b78c98d8e4..72779c8eddf44002fa0782d24a287ef6943914e0 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vlm.c: VLM interface plugin
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
+ * Copyright (C) 2000, 2001 the VideoLAN team
  * $Id$
  *
  * Authors: Simon Latapie <garf@videolan.org>
@@ -360,7 +360,11 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
 
             psz_temp = FindEndCommand( psz_cmd );
 
-            if( psz_temp == NULL ) goto error;
+            if( psz_temp == NULL )
+            {
+                p_message = vlm_MessageNew( "Incomplete command", psz_cmd );
+                goto error;
+            }
 
             i_temp = psz_temp - psz_cmd;
 
@@ -1348,7 +1352,7 @@ int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
         time.tm_year = 0;        /* year */
         time.tm_wday = 0;        /* day of the week */
         time.tm_yday = 0;        /* day in the year */
-        time.tm_isdst = 0;       /* daylight saving time */
+        time.tm_isdst = -1;       /* daylight saving time */
 
         /* date should be year/month/day-hour:minutes:seconds */
         p = strchr( psz_value, '-' );
@@ -1426,7 +1430,7 @@ int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
         time.tm_year = 0;        /* year */
         time.tm_wday = 0;        /* day of the week */
         time.tm_yday = 0;        /* day in the year */
-        time.tm_isdst = 0;       /* daylight saving time */
+        time.tm_isdst = -1;       /* daylight saving time */
 
         /* date should be year/month/day-hour:minutes:seconds */
         p = strchr( psz_value, '-' );
@@ -1743,9 +1747,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++ )
         {
@@ -1902,6 +1919,7 @@ static vlm_message_t *vlm_Help( vlm_t *vlm, char *psz_filter )
         MessageAddChild( "inputdel (input_name)|all" );
         MessageAddChild( "inputdeln input_number" );
         MessageAddChild( "output (output_name)" );
+        MessageAddChild( "option (option_name)[=value]" );
         MessageAddChild( "enabled|disabled" );
         MessageAddChild( "loop|unloop (broadcast only)" );
         MessageAddChild( "mux (mux_name)" );