@dan
I mean, the call:
WaitForSingleObject(hNeedDataEvent, INFINITE);
takes place several times in the loop iteration. You have to wonder: is that some auto-reset event that another thread has to be banging to to keep the playback going?
There is also a puzzling call to ZeroMemory in the code; why would you be doing that on data which isn't a secret that had just been decrypted.