http://bugs.winehq.org/show_bug.cgi?id=33045
--- Comment #6 from Andrew Eikum aeikum@codeweavers.com 2013-03-05 08:00:44 CST --- (In reply to comment #5)
(In reply to comment #3)
- Investigate what native does with trailing bytes in case of underrun.
Looks to me like they get thrown away. I wrote a test with two headers, one header is one byte short and the other is one byte long. After the first header plays, waveOutGetPosition(TIME_SAMPLES) reports one sample short. After the second header, it still reports exactly one sample short. Using TIME_BYTES similarly reports (dwBufferSize - dwBufferSize % nBlockAlign).
I should clarify, this is true even without the underrun. Queuing the two buffers immediately still results in a TIME_SAMPLES that's one sample short (and similarly for TIME_BYTES).