Skip to content

nvenc: fix a possible deadlock between acquire and stop

As we release the stream lock in acquire(), the entirety of the stop() method can complete before pop() is called which may attempt to pop an empty queue and wait forever.

Ensure that in acquire we retrieve the GAsyncQueue's lock before dropping the stream lock so that the GAsyncQueue will not be emptied by gst_nv_base_enc_reset_queues() when _pop() is called by acquire.

Also fix another deadlock where acquire is called but has no buffers to pull. Sometime later stop is called and will not release acquire from its neverending wait. Fix by sending a shutdown cookie through the input pool when required.

Fixes #912 (closed)

Merge request reports

Loading