aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:04 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:04 +0200
commit8d3942e0c3b4108e8968e914da75bf7c6c43f408 (patch)
tree69d7eba9eb5f0273a61698169088e0ee70cdb297 /src/decode.h
parent180d78a8e631cb4d48ef468709099a8c43d7ef51 (diff)
downloadmpd-8d3942e0c3b4108e8968e914da75bf7c6c43f408.tar.gz
mpd-8d3942e0c3b4108e8968e914da75bf7c6c43f408.tar.xz
mpd-8d3942e0c3b4108e8968e914da75bf7c6c43f408.zip
merged start, stop, seek into DecoderControl.command
Much of the existing code queries all three variables sequentially. Since only one of them can be set at a time, this can be optimized and unified by merging all of them into one enum variable. Later, the "command" checks can be expressed in a "switch" statement.
Diffstat (limited to 'src/decode.h')
-rw-r--r--src/decode.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/decode.h b/src/decode.h
index 990f5e57a..9418c8789 100644
--- a/src/decode.h
+++ b/src/decode.h
@@ -33,6 +33,13 @@ enum decoder_state {
DECODE_STATE_DECODE
};
+enum decoder_command {
+ DECODE_COMMAND_NONE = 0,
+ DECODE_COMMAND_START,
+ DECODE_COMMAND_STOP,
+ DECODE_COMMAND_SEEK
+};
+
#define DECODE_ERROR_NOERROR 0
#define DECODE_ERROR_UNKTYPE 10
#define DECODE_ERROR_FILE 20
@@ -41,10 +48,8 @@ typedef struct _DecoderControl {
Notify notify;
volatile enum decoder_state state;
- volatile mpd_sint8 stop;
- volatile mpd_sint8 start;
+ volatile enum decoder_command command;
volatile mpd_uint16 error;
- volatile mpd_sint8 seek;
volatile mpd_sint8 seekError;
volatile mpd_sint8 seekable;
volatile double seekWhere;