[vlc-devel] [PATCH 4/5] video_output: handle the terminate state internally in the control FIFO

Steve Lhomme robux4 at ycbcr.xyz
Fri Dec 18 09:32:28 UTC 2020


On 2020-12-18 9:57, Romain Vimont wrote:
> On Thu, Dec 17, 2020 at 05:44:19PM +0100, Thomas Guillem wrote:
>> Are you sure about this one?
>> Before your patch, TERMINATE was a pseudo drain, the vout thread was stopped once it had processed all controls. What about remaining pictures?
>>
>> On Thu, Dec 17, 2020, at 16:39, Steve Lhomme wrote:
>>> It doesn't push a dummy command anymore but sets an internal flag.
>>>
>>> If the control FIFO is terminated we don't wait for new commands before
>>> returning. There might be some pending mouse commands before the TERMINATED
>>> command (that is now removed).
> 
> Btw, currently, VOUT_CONTROL_TERMINATE terminates the vout thread, so no
> more vout_control_Pop() will never be called again.
> 
> What if a separate thread was waiting on vout_control_Hold()? It will
> hang forever.

In the end in v4 I moved back the terminate handling outside of 
control.c (after temporarily putting in it control.c). But there is 
indeed an issue. Before, the terminate state wasn't kept after it was 
handled. Now it stays in the vout_thread_t which is kept between 
consecutive vout thread creations (via vout_Request). So this state must 
be reset before the new thread starts.


More information about the vlc-devel mailing list