[vlc-devel] [PATCH 2/4] input: add a new variable storing which ES type was last modified

Felix Abecassis felix.abecassis at gmail.com
Mon Jul 21 14:23:19 CEST 2014

2014-07-19 8:30 GMT+02:00 Rémi Denis-Courmont <remi at remlab.net>:
> Le vendredi 18 juillet 2014, 19:40:50 Felix Abecassis a écrit :
>> ---
>>  src/input/event.c | 9 +++++++++
>>  src/input/var.c   | 2 ++
>>  2 files changed, 11 insertions(+)
> I still do not see how that ensures serialization. As far as I can tell, the
> ES lock is *not* mandatory at that point.

I am probably missing something here, I do not see what the problem is.
For instance, in input_SendEventPosition (src/input/event.c), we set
the variables "position" and "time" and set "intf-event" with
Setting "intf-event" triggers callback function input_event_changed
(src/lib/media_player.c), in this function we read variables
"position" and "time" and send a libvlc event using these values.
I don't understand how this situation is different from what I do in
my patch set.
Do you mean that functions input_SendEventEs* can be called
concurrently? Calls to these functions seems to be protected by a lock
in the EsOut functions (src/input/es_out.c).

> And even if that worked, eventually people would break it, as it's too easy to
> access the variable and make incorrect assumptions.

The variable name suggested by Francois sounds better, there should be
less confusion about the usage of this variable.

> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

Félix Abecassis

More information about the vlc-devel mailing list