output_thread: check again if output is open on CANCEL
When the player thread unpauses, it sends CANCEL to the output thread, after having checked that the output is still open. Problem is when the output thread closes the device before it can process the CANCEL command - race condition. This patch adds another "open" check inside the output thread.
This commit is contained in:
parent
6037beabe1
commit
2c908fde1b
1
NEWS
1
NEWS
|
@ -5,6 +5,7 @@ ver 0.15.5 (2009/??/??)
|
|||
* tags:
|
||||
- riff, aiff: fixed "limited range" gcc warning
|
||||
* decoder_thread: change the fallback decoder name to "mad"
|
||||
* output_thread: check again if output is open on CANCEL
|
||||
|
||||
|
||||
ver 0.15.4 (2009/10/03)
|
||||
|
|
|
@ -257,7 +257,8 @@ static gpointer audio_output_task(gpointer arg)
|
|||
|
||||
case AO_COMMAND_CANCEL:
|
||||
ao->chunk = NULL;
|
||||
ao_plugin_cancel(ao->plugin, ao->data);
|
||||
if (ao->open)
|
||||
ao_plugin_cancel(ao->plugin, ao->data);
|
||||
ao_command_finished(ao);
|
||||
|
||||
/* the player thread will now clear our music
|
||||
|
|
Loading…
Reference in New Issue