player_control: protect command, state, error with a mutex
Use GMutex/GCond instead of the notify library. Manually lock the player_control object before accessing the protected attributes. Use the GCond object to notify the player thread and the main thread.
This commit is contained in:
@@ -58,10 +58,7 @@ need_chunks(struct input_stream *is, bool do_wait)
|
||||
|
||||
if ((is == NULL || decoder_input_buffer(is) <= 0) && do_wait) {
|
||||
decoder_wait();
|
||||
|
||||
decoder_unlock();
|
||||
notify_signal(&pc.notify);
|
||||
decoder_lock();
|
||||
player_signal();
|
||||
|
||||
return dc.command;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user