[vlc-devel] [PATCH 1/4] vlm: remove schedule media type

Pierre Ynard linkfanel at yahoo.fr
Sat Aug 29 02:17:13 CEST 2020


> @@ -762,28 +639,18 @@ error:
>  static int ExecuteNew( vlm_t *p_vlm, const char *psz_name, const char *psz_type, const int i_property, char *ppsz_property[], vlm_message_t **pp_status )
>  {
>      /* Check name */
> -    if( !strcmp( psz_name, "all" ) || !strcmp( psz_name, "media" ) || !strcmp( psz_name, "schedule" ) )
> +    if( !strcmp( psz_name, "all" ) || !strcmp( psz_name, "media" ) )
>      {
> -        *pp_status = vlm_MessageNew( "new", "\"all\", \"media\" and \"schedule\" are reserved names" );
> +        *pp_status = vlm_MessageNew( "new", "\"all\" and \"media\" are reserved names" );
>          return VLC_EGENERIC;
>      }
> -    if( ExecuteIsMedia( p_vlm, psz_name ) || ExecuteIsSchedule( p_vlm, psz_name ) )
> +    if( ExecuteIsMedia( p_vlm, psz_name ) )
>      {
>          *pp_status = vlm_MessageNew( "new", "%s: Name already in use", psz_name );
>          return VLC_EGENERIC;
>      }
>      /* */
> -    if( !strcmp( psz_type, "schedule" ) )
> -    {
> -        vlm_schedule_sys_t *p_schedule = vlm_ScheduleNew( p_vlm, psz_name );
> -        if( !p_schedule )
> -        {
> -            *pp_status = vlm_MessageNew( "new", "could not create schedule" );
> -            return VLC_EGENERIC;
> -        }
> -        return ExecuteScheduleProperty( p_vlm, p_schedule, true, i_property, ppsz_property, pp_status );
> -    }
> -    else if( !strcmp( psz_type, "broadcast" ) )
> +    if( !strcmp( psz_type, "broadcast" ) )
>      {
>          vlm_media_t cfg;
>          int64_t id;

This should still print an error when trying to create a schedule,
explaining that the feature is gone and pointing the user to
documentation or alternatives. There should also be the same thing for
vod, really.

> @@ -802,19 +669,14 @@ static int ExecuteNew( vlm_t *p_vlm, const char *psz_name, const char *psz_type,
>      }
>      else
>      {
> -        *pp_status = vlm_MessageNew( "new", "%s: Choose between broadcast or schedule", psz_type );
> +        *pp_status = vlm_MessageNew( "new", "%s: unknown media type", psz_type );
>          return VLC_EGENERIC;
>      }
>  }

This isn't really helpful as an error message, in particular if the
documentation gets updated to remove mentions of several possible object
types, in addition to broadcast. The command parser could even be
updated to make `broadcast` optional if not followed by any properties:
that is, to accept a shorter `new <name>` command syntax.

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the vlc-devel mailing list