I'm using the winmm.dll
API method waveOutGetPosition
to get the current position of the playback of a WAV file. Sometimes this works as expected for me, but eventually one of the calls never returns and my application locks up.
I found this thread with a few users who have experienced the same problem:
but no solution. Has anyone run into this problem before?
Update: I was able to create a sample app that reproduces the problem reliably:
Problem with waveOutWrite and waveOutGetPosition deadlock
Still haven't fixed it, though.
The solution is to use a MessageWindow instead of a callback - the MessageWindow allows waveOutGetPosition to return successfully without deadlocking.