aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-07 15:37:18 +0100
committerMax Kellermann <max@duempel.org>2009-11-07 15:37:18 +0100
commit3546d931a1bc153ba1416ca837b4c00f1495d7e5 (patch)
tree95623e67152f0fdac7345d4f7215affea8cbbb67 /src/decoder_thread.c
parent4dadb965a70e82559e78547d5e2d5de3f42df224 (diff)
downloadmpd-3546d931a1bc153ba1416ca837b4c00f1495d7e5.tar.gz
mpd-3546d931a1bc153ba1416ca837b4c00f1495d7e5.tar.xz
mpd-3546d931a1bc153ba1416ca837b4c00f1495d7e5.zip
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.
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r--src/decoder_thread.c6
1 files changed, 6 insertions, 0 deletions
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);