decoder_thread: open input stream after command finished
Return the result to the caller more quickly. This unifies error handling: no error can be reported before the command is finished.
This commit is contained in:
parent
59ffb5b7c1
commit
77a647fc26
@ -101,11 +101,6 @@ decoder_run_song(struct decoder_control *dc,
|
|||||||
struct input_stream input_stream;
|
struct input_stream input_stream;
|
||||||
const struct decoder_plugin *plugin;
|
const struct decoder_plugin *plugin;
|
||||||
|
|
||||||
if (!input_stream_open(&input_stream, uri)) {
|
|
||||||
dc->state = DECODE_STATE_ERROR;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
decoder.seeking = false;
|
decoder.seeking = false;
|
||||||
decoder.song_tag = song->tag != NULL && song_is_file(song)
|
decoder.song_tag = song->tag != NULL && song_is_file(song)
|
||||||
? tag_dup(song->tag) : NULL;
|
? tag_dup(song->tag) : NULL;
|
||||||
@ -118,6 +113,16 @@ decoder_run_song(struct decoder_control *dc,
|
|||||||
|
|
||||||
player_signal();
|
player_signal();
|
||||||
|
|
||||||
|
decoder_unlock(dc);
|
||||||
|
|
||||||
|
if (!input_stream_open(&input_stream, uri)) {
|
||||||
|
decoder_lock(dc);
|
||||||
|
dc->state = DECODE_STATE_ERROR;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
decoder_lock(dc);
|
||||||
|
|
||||||
/* wait for the input stream to become ready; its metadata
|
/* wait for the input stream to become ready; its metadata
|
||||||
will be available then */
|
will be available then */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user