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/aac_plugin.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/inputPlugins/aac_plugin.c') diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index f1c1d9303..81e5d5656 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -392,13 +392,13 @@ static int aac_decode(char *path) sampleBufferLen = sampleCount * 2; ob_send(NULL, 0, sampleBuffer, - sampleBufferLen, file_time, - bitRate, NULL); - if (dc.seek) { + sampleBufferLen, file_time, + bitRate, NULL); + if (dc.command == DECODE_COMMAND_SEEK) { dc.seekError = 1; - dc.seek = 0; + dc.command = DECODE_COMMAND_NONE; decoder_wakeup_player(); - } else if (dc.stop) { + } else if (dc.command == DECODE_COMMAND_STOP) { eof = 1; break; } @@ -413,9 +413,9 @@ static int aac_decode(char *path) if (dc.state != DECODE_STATE_DECODE) return -1; - if (dc.seek) { + if (dc.command == DECODE_COMMAND_SEEK) { dc.seekError = 1; - dc.seek = 0; + dc.command = DECODE_COMMAND_NONE; decoder_wakeup_player(); } -- cgit v1.2.3