On Fri Sep 8 10:27:13 2023 +0000, Rémi Bernon wrote:
Sorry for noticing this now but I think you should really avoid the condition variable (and perhaps not even need the mutex). The pthread condition variables are broken and cause random crashes on process termination (in my opinion we should completely get rid of them in winegstreamer). Things will be simpler if the muxer works in a synchronous way, producing buffers only when samples are pushed. Also, maybe you can delay adding the output queue until you actually use it.
The problem is that: the gstreamer muxer element itself is using GstTask(https://gstreamer.freedesktop.org/documentation/gstreamer/gsttask.html) at its src pad. GstTask will launch a new thread. In order to synchronize the GstTask thread and our executing main thread, pthread is needed.