First we set the EOS state, so the wait_parser_stream_buffer function doesn't call pthread_cond_wait again. Then we must call pthread_cond_signal to make sure that no one is waiting for it, if we don't do that, there is the possibility of hanging wg_parser_disconnect at the free_stream call, because pthread_cond_destroy will hang when the cond object is being waited by other threads.
Specifically this helps to fix a hang in some applications, specially Unreal Engine games when changing sources too fast in a MediaPlayer.