From 8d3942e0c3b4108e8968e914da75bf7c6c43f408 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:04 +0200 Subject: 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. --- src/inputPlugins/mod_plugin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/inputPlugins/mod_plugin.c') diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c index 21da5832..5f4adb33 100644 --- a/src/inputPlugins/mod_plugin.c +++ b/src/inputPlugins/mod_plugin.c @@ -187,13 +187,13 @@ static int mod_decode(char *path) dc.state = DECODE_STATE_DECODE; while (1) { - if (dc.seek) { + if (dc.command == DECODE_COMMAND_SEEK) { dc.seekError = 1; - dc.seek = 0; + dc.command = DECODE_COMMAND_NONE; decoder_wakeup_player(); } - if (dc.stop) + if (dc.command == DECODE_COMMAND_STOP) break; if (!Player_Active()) -- cgit v1.2.3