Commit 3546d931 authored by Max Kellermann's avatar Max Kellermann

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.
parent 4dadb965
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment