This project has moved. For the latest updates, please go here.

WaveOut.Pause() call creating deadlock

Feb 22, 2016 at 7:15 PM
Calling Pause() and Play() a few times (3-4 times in many cases) creates a deadlock for me. Digging down the problem I found that there are two threads, one in the Pause() function and the other in the Callback(), both trying to acquire lock on waveOutLock, thus creating a deadlock.

I see that this issue has been raised several times before. On one such occasion the proposed solution was to simply move the following line in the Pause() function ABOVE the lock statement:
     playbackState = PlaybackState.Paused;
I read that the author of Naudio accepted this solution and said he was going to incorporate this into NAudio. But as of the current version this line is still BELOW the lock statement, thus causing the deadlock. Was this change ever incorporated and then reverted back for some reason? (I just checked and it DOES solve my problem).
Coordinator
Sep 27, 2016 at 9:45 AM
this change has now been made