From 3546d931a1bc153ba1416ca837b4c00f1495d7e5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 7 Nov 2009 15:37:18 +0100 Subject: 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. --- src/decoder_thread.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/decoder_thread.c b/src/decoder_thread.c index e9dead4ed..95dbf8d75 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -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); -- cgit v1.2.3