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.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 1440fc272..46349f53b 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "decoder_thread.h"
+#include "decoder_error.h"
#include "decoder_control.h"
#include "decoder_internal.h"
#include "decoder_list.h"
@@ -428,12 +429,27 @@ decoder_run_song(struct decoder_control *dc,
decoder_lock(dc);
- dc->state = ret ? DECODE_STATE_STOP : DECODE_STATE_ERROR;
+ if (ret)
+ dc->state = DECODE_STATE_STOP;
+ else {
+ dc->state = DECODE_STATE_ERROR;
+
+ const char *error_uri = song->uri;
+ char *allocated = uri_remove_auth(error_uri);
+ if (allocated != NULL)
+ error_uri = allocated;
+
+ dc->error = g_error_new(decoder_quark(), 0,
+ "Failed to decode %s", error_uri);
+ g_free(allocated);
+ }
}
static void
decoder_run(struct decoder_control *dc)
{
+ dc_clear_error(dc);
+
const struct song *song = dc->song;
char *uri;
@@ -446,6 +462,9 @@ decoder_run(struct decoder_control *dc)
if (uri == NULL) {
dc->state = DECODE_STATE_ERROR;
+ dc->error = g_error_new(decoder_quark(), 0,
+ "Failed to map song");
+
decoder_command_finished_locked(dc);
return;
}