On Fri Nov 18 00:25:05 2022 +0000, Zebediah Figura wrote:
This is suspicious. Why do we need this? Note also that this isn't thread-safe either; as soon as we drop the critical section we can already have been shut down.
I agree it's a bit weird, but `wg_parser_stream_get_buffer()` can block, and if the lock is kept basically no other media source or media stream method can be called. In general the lock shouldn't be kept for long, but in some cases it could. For example, we could be reading from a slow network.
I agree at this point it's still unsafe, but that's fixed in a later patch ("winegstreamer: Synchronize media source async commands and shutdown.").