[vlc] Re: Sharing information between http interface instances.

Michel Van den Bergh michel.vandenbergh at uhasselt.be
Tue Aug 15 10:20:13 CEST 2006


Chhaya, Harshal wrote:

>Michel Van den Bergh wrote:
>  
>
>>I found out that it is easy to add variables to vlc  which are then 
>>accessible from all instances of all interfaces (it requires modifying
>>    
>>
>
>  
>
>>the source and recompiling though).  So this is what I do.
>>    
>>
>
>Michel,
>
>Thanks for following up with the answer. Could you give more
>details as to what files and functions you had to change?
>
>Thanks,
>- Harshal
>
>  
>
Hi,

The patch below to the file vlc-0.8.5/src/playlist/playlist.c
creates a variable "timestamp" in the object VLC_OBJECT_PLAYLIST and
initializes
it to the current time. It can be set and read using the macros
"vlc_var_set" and
"vlc_var_get".

I use this in the following way for my homebrown ajax http interface: if
a http client updates the playlist it sets the timestamp (using
javascript and a XMLHttpRequest). The other clients (polling the
timestamp variable with a periodic XMLHttpRequest) then
note that their own copy of the playlist is no longer up to date and
perform  a reload.

This scales much better than the standard http interface scripts that
come with vlc-0.8.5.

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