[vlc-devel] [PATCH] Display title only once for one item

Rafaël Carré funman at videolan.org
Sun Jan 13 12:48:13 CET 2013


Would it work with HLS too ?

Apparently there title is shown when changing segment resolution (so not
for each segment of the same size)

Le 12/01/2013 11:55, Denis Charmet a écrit :
> Fix #5715
> ---
>  include/vlc_input_item.h |    1 +
>  src/input/item.c         |    1 +
>  src/input/resource.c     |    4 ++++
>  3 files changed, 6 insertions(+)
> 
> diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
> index 0f9800d..537a158 100644
> --- a/include/vlc_input_item.h
> +++ b/include/vlc_input_item.h
> @@ -88,6 +88,7 @@ struct input_item_t
>      uint8_t     i_type;              /**< Type (file, disc, ... see input_item_type_e) */
>      bool        b_fixed_name;        /**< Can the interface change the name ?*/
>      bool        b_error_when_reading;/**< Error When Reading */
> +    bool        b_title_shown;       /**< Has the title already been shown? */
>  };
>  
>  enum input_item_type_e
> diff --git a/src/input/item.c b/src/input/item.c
> index e225657..a5dc689 100644
> --- a/src/input/item.c
> +++ b/src/input/item.c
> @@ -864,6 +864,7 @@ input_item_NewWithType( const char *psz_uri, const char *psz_name,
>          p_input->i_type = type;
>      p_input->b_fixed_name = false;
>      p_input->b_error_when_reading = false;
> +    p_input->b_title_shown = false;
>      return p_input;
>  }
>  
> diff --git a/src/input/resource.c b/src/input/resource.c
> index 25f979b..bd22f8b 100644
> --- a/src/input/resource.c
> +++ b/src/input/resource.c
> @@ -157,6 +157,9 @@ static void DisplayVoutTitle( input_resource_t *p_resource,
>  
>      input_item_t *p_item = input_GetItem( p_resource->p_input );
>  
> +    if( p_item->b_title_shown )
> +        return;
> +
>      char *psz_nowplaying = input_item_GetNowPlaying( p_item );
>      if( psz_nowplaying && *psz_nowplaying )
>      {
> @@ -189,6 +192,7 @@ static void DisplayVoutTitle( input_resource_t *p_resource,
>          free( psz_artist );
>      }
>      free( psz_nowplaying );
> +    p_item->b_title_shown = true;
>  }
>  static vout_thread_t *RequestVout( input_resource_t *p_resource,
>                                     vout_thread_t *p_vout,
> 




More information about the vlc-devel mailing list