decoder_control: add GError attribute

This commit is contained in:
Max Kellermann
2012-08-08 21:54:54 +02:00
parent 0b9e912297
commit 8c425c758c
5 changed files with 107 additions and 1 deletions

View File

@@ -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;