aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-31 16:29:24 +0100
committerMax Kellermann <max@duempel.org>2008-10-31 16:29:24 +0100
commit347e816247a75cbcc8c3c02f206f3c07005dc069 (patch)
tree0f355fe86ce35990500844ec234c519b26216281 /src/decoder_thread.c
parent86fbac54fd47dc21f3689d0efac207f3d6905927 (diff)
downloadmpd-347e816247a75cbcc8c3c02f206f3c07005dc069.tar.gz
mpd-347e816247a75cbcc8c3c02f206f3c07005dc069.tar.xz
mpd-347e816247a75cbcc8c3c02f206f3c07005dc069.zip
decoder: reset state and command in decoder_task()
Eliminate one goto in decodeStart() by moving some cleanup to decoder_task().
Diffstat (limited to '')
-rw-r--r--src/decoder_thread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 389634896..822931a61 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -46,7 +46,7 @@ static void decodeStart(void)
dc.current_song = dc.next_song; /* NEED LOCK */
if (!input_stream_open(&inStream, path_max_fs)) {
dc.error = DECODE_ERROR_FILE;
- goto stop_no_close;
+ return;
}
decoder.seeking = false;
@@ -159,9 +159,6 @@ static void decodeStart(void)
stop:
if (close_instream)
input_stream_close(&inStream);
-stop_no_close:
- dc.state = DECODE_STATE_STOP;
- dc.command = DECODE_COMMAND_NONE;
}
static void * decoder_task(mpd_unused void *arg)
@@ -173,6 +170,9 @@ static void * decoder_task(mpd_unused void *arg)
case DECODE_COMMAND_START:
case DECODE_COMMAND_SEEK:
decodeStart();
+
+ dc.state = DECODE_STATE_STOP;
+ dc.command = DECODE_COMMAND_NONE;
break;
case DECODE_COMMAND_STOP: