aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-08 15:48:00 +0100
committerMax Kellermann <max@duempel.org>2008-11-08 15:48:00 +0100
commit72eba30cf442994c732c135cb77c917f534ff1d7 (patch)
tree43cdc79105e4cea79296274bca00f67dfd636cb7 /src/decoder_control.c
parent8cbdc2667e6f4f3713c329ae21aa3d8ae73fab24 (diff)
downloadmpd-72eba30cf442994c732c135cb77c917f534ff1d7.tar.gz
mpd-72eba30cf442994c732c135cb77c917f534ff1d7.tar.xz
mpd-72eba30cf442994c732c135cb77c917f534ff1d7.zip
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".
Diffstat (limited to '')
-rw-r--r--src/decoder_control.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c
index a1719a6f6..efc8ac797 100644
--- a/src/decoder_control.c
+++ b/src/decoder_control.c
@@ -27,7 +27,6 @@ void dc_init(void)
notify_init(&dc.notify);
dc.state = DECODE_STATE_STOP;
dc.command = DECODE_COMMAND_NONE;
- dc.error = DECODE_ERROR_NOERROR;
}
void dc_deinit(void)
@@ -63,7 +62,6 @@ dc_start(struct notify *notify, struct song *song)
assert(song != NULL);
dc.next_song = song;
- dc.error = DECODE_ERROR_NOERROR;
dc_command(notify, DECODE_COMMAND_START);
}
@@ -73,7 +71,6 @@ dc_start_async(struct song *song)
assert(song != NULL);
dc.next_song = song;
- dc.error = DECODE_ERROR_NOERROR;
dc_command_async(DECODE_COMMAND_START);
}
@@ -81,7 +78,7 @@ void
dc_stop(struct notify *notify)
{
if (dc.command == DECODE_COMMAND_START ||
- dc.state != DECODE_STATE_STOP)
+ (dc.state != DECODE_STATE_STOP && dc.state != DECODE_STATE_ERROR))
dc_command(notify, DECODE_COMMAND_STOP);
}
@@ -90,7 +87,8 @@ dc_seek(struct notify *notify, double where)
{
assert(where >= 0.0);
- if (dc.state == DECODE_STATE_STOP || !dc.seekable)
+ if (dc.state == DECODE_STATE_STOP ||
+ dc.state == DECODE_STATE_ERROR || !dc.seekable)
return false;
dc.seek_where = where;