aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r--src/decoder_thread.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 95dbf8d75..9c12ecb07 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -257,6 +257,7 @@ decoder_run_file(struct decoder *decoder, const char *path_fs)
decoder_unlock(dc);
} else if (plugin->stream_decode != NULL) {
struct input_stream input_stream;
+ bool success;
if (!decoder_input_stream_open(dc, &input_stream,
path_fs))
@@ -264,11 +265,17 @@ decoder_run_file(struct decoder *decoder, const char *path_fs)
decoder_lock(dc);
- if (decoder_stream_decode(plugin, decoder,
- &input_stream))
- return true;
+ success = decoder_stream_decode(plugin, decoder,
+ &input_stream);
decoder_unlock(dc);
+
+ input_stream_close(&input_stream);
+
+ if (success) {
+ decoder_lock(dc);
+ return true;
+ }
}
}