decoder_thread: check for STOP before calling the plugin
Before calling the plugin's decode method, we should ensure that we didn't receive a STOP command during initialization.
This commit is contained in:
parent
4dadb965a7
commit
3546d931a1
@ -96,6 +96,9 @@ decoder_stream_decode(const struct decoder_plugin *plugin,
|
||||
assert(input_stream->ready);
|
||||
assert(decoder->dc->state == DECODE_STATE_START);
|
||||
|
||||
if (decoder->dc->command == DECODE_COMMAND_STOP)
|
||||
return true;
|
||||
|
||||
decoder_unlock(decoder->dc);
|
||||
|
||||
/* rewind the stream, so each plugin gets a fresh start */
|
||||
@ -124,6 +127,9 @@ decoder_file_decode(const struct decoder_plugin *plugin,
|
||||
assert(g_path_is_absolute(path));
|
||||
assert(decoder->dc->state == DECODE_STATE_START);
|
||||
|
||||
if (decoder->dc->command == DECODE_COMMAND_STOP)
|
||||
return true;
|
||||
|
||||
decoder_unlock(decoder->dc);
|
||||
|
||||
decoder_plugin_file_decode(plugin, decoder, path);
|
||||
|
Loading…
Reference in New Issue
Block a user