[vlc-devel] [PATCH 1/2] stream: add stream_DemuxAlive

Julian Scheel julian at jusst.de
Mon Apr 20 17:06:44 CEST 2015

On 20.04.2015 16:59, Rémi Denis-Courmont wrote:
>> Which brings us back to the initial patch by Francois...
>> Just as francois I don't really see why it's racy - it's just allowing
>> to read an atomic state variable from outside. But I surely miss
>> something due to lack of knowledge about the stream_Demux internals?
> It's racy with regards to event sequencing, not memory access. What do you do
> if the inner demux terminates while the outer demux is blocked on some
> unrelated operation?
> Typically, the outer demux will waiting for reading data from the outer stream
> (or equivalent for access_demux).

Agreed, but in this case I see two options only:
(a) The outer demux will timeout at some point if no further data comes 
in and thus shutdown as well
(b) It will receive further data so it's unblocking, seeing the inner 
demux was finalized and can shutdown then as well

Any other blocking operation which could occur doesn't seem to be 
related to the inner demux being alive or not afaics. And would be 
equally harmful with or without this patch, wouldn't it.


More information about the vlc-devel mailing list