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

Johannes Marbach johannesmarbach at googlemail.com
Wed Oct 12 14:11:14 CEST 2011


You mean the meta data could possibly be changed between the if statement
and the call to input_item_SetNowPlaying / input_item_SetPublisher? That
would imply that we'd need to lock the input item before the if check,
right?

2011/10/12 Rémi Denis-Courmont <remi at remlab.net>

> 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/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111012/d0c56752/attachment.html>


More information about the vlc-devel mailing list