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?<br>
<br><div class="gmail_quote">2011/10/12 Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net">remi@remlab.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, 12 Oct 2011 13:52:39 +0200, Johannes Marbach<br>
<<a href="mailto:johannesmarbach@googlemail.com">johannesmarbach@googlemail.com</a>> wrote:<br>
>      /* Update now playing */<br>
> -    input_item_SetNowPlaying( p_input->p->p_item,<br>
p_pgrm->psz_now_playing<br>
> );<br>
> -    input_item_SetPublisher( p_input->p->p_item, p_pgrm->psz_publisher<br>
);<br>
> +    if( vlc_meta_CompareValues( input_item_GetNowPlaying(<br>
> p_input->p->p_item ), p_pgrm->psz_now_playing ) )<br>
> +        input_item_SetNowPlaying( p_input->p->p_item,<br>
> p_pgrm->psz_now_playing );<br>
<br>
</div>I think there is a TOCTOU race here.<br>
<div class="im"><br>
><br>
> -    input_SendEventMeta( p_input );<br>
> +    /* Update publisher */<br>
> +    if( vlc_meta_CompareValues( input_item_GetPublisher(<br>
> p_input->p->p_item ), p_pgrm->psz_publisher ) )<br>
> +        input_item_SetPublisher( p_input->p->p_item,<br>
> p_pgrm->psz_publisher );<br>
<br>
</div>Same here and so on.<br>
<font color="#888888"><br>
--<br>
Rémi Denis-Courmont<br>
<a href="http://www.remlab.net/" target="_blank">http://www.remlab.net/</a><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br>
</font></blockquote></div><br>