[vlc] Re: Sharing information between http interface instances.
Michel Van den Bergh
michel.vandenbergh at uhasselt.be
Mon Aug 21 08:27:32 CEST 2006
Clément Stenac wrote:
>If I understand correctly, it's used directly in the HTTP interface
>scripts. This is not ideal as your clients won't notice if the playlist is
>updated by something else than by another client. For example, a services
>discovery module might add something and you will not notice it.
>
>A better way would have to have a "serial" variable in p_playlist, and to
>update it each time a modification is made to the playlist.
>
>By the way, how does the HTTP interrface currently handle playlist updates
>(don't have access to the code here) ?
>
>
>
I created a serial variable in p_playlist by hooking up a callback
"IncrementSerial" to
intf-change. This works reasonable well. Unfortunately not all
interfaces touch intf-change
when they change the playlist.
Case in point (for vlc-0.8.5): in the http interface if you perform the
sort command then you actually
call playlist_RecursiveNodeSort which does not touch intf-change. Worse
(and this is a buglet I think),
playlist_RecursiveNodeSort is entered without the playlist lock, so it
is not thread safe.
So I created a wrapper around playlist_RecursiveNodeSort which fixes
the issues mentionned in the previous paragraph.
I then use this wrapper function in the http interface instead of the
original playlist_RecursiveNodeSort.
Regards,
Michel
--
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html
More information about the vlc
mailing list