aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
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 eca8d8599..d02e6985c 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -121,12 +121,11 @@ decoder_run_song(struct decoder_control *dc,
return;
}
- decoder_lock(dc);
-
/* wait for the input stream to become ready; its metadata
will be available then */
while (!input_stream.ready) {
+ decoder_lock(dc);
if (dc->command == DECODE_COMMAND_STOP) {
decoder_unlock(dc);
input_stream_close(&input_stream);
@@ -136,6 +135,7 @@ decoder_run_song(struct decoder_control *dc,
}
decoder_unlock(dc);
+
ret = input_stream_buffer(&input_stream);
if (ret < 0) {
input_stream_close(&input_stream);
@@ -143,10 +143,10 @@ decoder_run_song(struct decoder_control *dc,
dc->state = DECODE_STATE_ERROR;
return;
}
-
- decoder_lock(dc);
}
+ decoder_lock(dc);
+
if (dc->command == DECODE_COMMAND_STOP) {
decoder_unlock(dc);
input_stream_close(&input_stream);