decoder: converted dc.error to a dc.state value

The player did not care about the exact error value, it only checked
whether an error has occured.  This could fit well into
decoder_control.state - introduce a new state "DECODE_STATE_ERROR".
This commit is contained in:
Max Kellermann
2008-11-08 15:48:00 +01:00
parent 8cbdc2667e
commit 72eba30cf4
4 changed files with 43 additions and 29 deletions

View File

@@ -93,7 +93,7 @@ static int player_wait_for_decoder(struct player *player)
{
dc_command_wait(&pc.notify);
if (dc.error != DECODE_ERROR_NOERROR) {
if (decoder_has_failed()) {
assert(dc.next_song == NULL || dc.next_song->url != NULL);
pc.errored_song = dc.next_song;
pc.error = PLAYER_ERROR_FILE;
@@ -305,7 +305,7 @@ static void do_play(void)
}
if (player.decoder_starting) {
if (dc.error != DECODE_ERROR_NOERROR) {
if (decoder_has_failed()) {
/* the decoder failed */
assert(dc.next_song == NULL || dc.next_song->url != NULL);
pc.errored_song = dc.next_song;