[vlc-devel] Demux/Stream pause state propagation

Rémi Denis-Courmont remi at remlab.net
Sat Oct 10 23:15:24 CEST 2015

Le 2015-10-10 16:56, Francois Cartegnie a écrit :
> Hi,
> On pause, the input does notify new state to demux or its slave 
> stream:

No. It notifies the access_demux or the stream, whichever exists:

> if( p_demux->s != NULL )
>     i_ret = stream_Control( p_demux->s, STREAM_SET_PAUSE_STATE, true 
> );
> else
>     i_ret = demux_Control( p_demux, DEMUX_SET_PAUSE_STATE, true );

This is of course wrong. It should notify the (access_)demux always and 
leave p_demux->s alone. I moved from access to stream to fix decomp and 
enable prefetch stream filters - I did nott fix the design all the way 
through to the demux because I had no need and thus no motivation to do 

> The problem being, for example, adaptive, the slave stream is a fully
> read manifest, does exist, and will always succeed. The demuxer will
> never get notified.

Yes. SDP->RTSP demux exhibits or would exhibit the same problem.

> I believe notifying both by default would raise some new issues.

It would make no sense.

> I see three options then:
> * Have the streams fail on SET_PAUSE_STATE when they reach eof.
> Probably incorrect as they can still seek.

That does not solve much. Pause will fail safe instead of failing 
"unsafe". You probably want pause to succeed.

> * Have new demux flag for routing this control.

You could check if DEMUX_CAN_PAUSE return an error. But that is hackish 
and it seems likely that some plugin would get it wrong, if it hasn't 
been gotten wrong already.

> * Add new signal/control to notify demuxer its stream handled pause.

That's exactly what DEMUX_SET_PAUSE_STATE ought to do. But it's not 
implemented by any or almost any (non-access_)demux so far.

Rémi Denis-Courmont

More information about the vlc-devel mailing list