I suggest to make two buffers. One to play from and other to decode to.
Code which plays the buffers will set hBufferPlayedEvent by calling SetEvent(hBufferPlayedEvent) when it ends with one buffer and switches to other (just swapping pointers). Decoding thread will get this event and will start decoding to buffer which was just played. Backbuffer technique.

You decoding threads's code will be something like this:
Code:
while not terminated do 
  begin 
    updatebuffer; 
    WaitforSingleObject(hBufferPlayedEvent, INFINITE); 
  end;
Actually it's better to use WaitforMultipleObjects() to correctly exit the loop when program terminates, but it's "premature optimizations" for now.