This includes some fixes for obvious mistakes as well as initial cleanup of the WM async reader, in preparation for implementing proper threading support.
The cleanup is certainly appreciated, but what's broken about our current threading?
The qasf (https://gitlab.winehq.org/wine/wine/-/merge_requests/686) and wmvcore (https://gitlab.winehq.org/wine/wine/-/merge_requests/685) tests show that there's actually at least one thread per stream, and likely two (one waiting / and eventually delivering samples, and one allocating samples), in addition to the callback thread.
I'm planning on doing some more refactoring first, ultimately implementing the async reader on top of the sync reader, and removing the need for a private interface. I've checked that it can indeed work on Windows too, and it'll make the code simpler overall.
What about the code is actually made simpler?
It will move all the async reader specific behavior to the async reader side, making it possible to move it out of winegstreamer and look at it alone.
Current wm_reader is a mix of different use cases, depending on whether it's used from the async or sync side, and it complicates the code.
Refactoring will also remove the internal struct wm_reader object, merging it with the sync reader, as well as the internal helpers which are just there to factor the implementation between the sync and async reader equivalents. Most async reader functions can be implemented as a direct forward to the sync reader functions and currently some sync reader methods areimplemented and not the async ones, and reversely, depending on what was needed.
One of the reasons I tend to avoid implementing one externally visible API on top of another is that it tends to make logs harder to read (mostly due to the extra clutter). That's not to say I'm sure it's not worth it in this case, but it's not immediately clear to me that the code would get a lot simpler.
I get that, but for most functions I don't think there's any need to log the async reader side as they are just proxying the call to the sync reader.