https://bugs.winehq.org/show_bug.cgi?id=53475
--- Comment #8 from ilkka.prusi@gmail.com --- I noticed something strange in dsound_render_sink_eos() in dsoundrenderer.c.
There is sequence of Lock(), memset(..0..), Unlock() before leaving the method. However: a) if this is the last use of the sample and buffer will be destroyed b) if the buffer will be reused new data will overwrite existing on next use
In both cases, why bother waiting to set the buffer to zero?
This leads to next thing: before that reset there is call to DSoundRender_HandleEndOfStream() (which I mentioned earlier) and that looks like a place where you could get infinite wait. This is also the only place where that method is called and all it does is call DSoundRender_UpdatePositions() in a loop.
Commenting out that HandleEndOfStream() removes the "underrun" error from happening so that error might be bogus. And it does not seem to interfere with samples playing (I didn't notice problems in a quick test. That makes a call to UpdatePositions(), which maybe isn't needed if you are about to stop the stream anyway?
This does not stop GStreamer error and the hang from happening but with these simplifications maybe the error for "underrun" does not matter.
Maybe rest of the code can be simplified in same way.