To make the code more consistent, call quitDecode() only at the end of decodeParent().
Move code which runs in the player thread to player_thread.c. Having a lot of player thread code in decode.c isn't easy to understand.