[vlc-devel] [PATCH] Adjusted meta data signalling to only send events when the meta data has actually changed.

Rémi Denis-Courmont remi at remlab.net
Wed Oct 12 14:03:09 CEST 2011


On Wed, 12 Oct 2011 13:52:39 +0200, Johannes Marbach
<johannesmarbach at googlemail.com> wrote:
>      /* Update now playing */
> -    input_item_SetNowPlaying( p_input->p->p_item,
p_pgrm->psz_now_playing
> );
> -    input_item_SetPublisher( p_input->p->p_item, p_pgrm->psz_publisher
);
> +    if( vlc_meta_CompareValues( input_item_GetNowPlaying(
> p_input->p->p_item ), p_pgrm->psz_now_playing ) )
> +        input_item_SetNowPlaying( p_input->p->p_item,
> p_pgrm->psz_now_playing );

I think there is a TOCTOU race here.

>  
> -    input_SendEventMeta( p_input );
> +    /* Update publisher */
> +    if( vlc_meta_CompareValues( input_item_GetPublisher(
> p_input->p->p_item ), p_pgrm->psz_publisher ) )
> +        input_item_SetPublisher( p_input->p->p_item,
> p_pgrm->psz_publisher );

Same here and so on.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list