From e530181e233f315f90c31e0d4aae63449222f46c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:15 +0200 Subject: check decoder_command!=NONE instead of decoder_command==STOP The code said "decoder_command==STOP" because that was a conversion from the old "dc->stop" test. As we can now check for all commands in one test, we can simply rewrite that to decoder_command!=NONE. --- src/inputPlugins/mp3_plugin.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/inputPlugins/mp3_plugin.c') diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index be309d3a6..9b22dc74c 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -700,16 +700,16 @@ static int decodeFirstFrame(mp3DecodeData * data, while (1) { while ((ret = decodeNextFrameHeader(data, tag, replayGainInfo)) == DECODE_CONT && - (!decoder || decoder_get_command(decoder) != DECODE_COMMAND_STOP)); + (!decoder || decoder_get_command(decoder) == DECODE_COMMAND_NONE)); if (ret == DECODE_BREAK || - (decoder && decoder_get_command(decoder) == DECODE_COMMAND_STOP)) + (decoder && decoder_get_command(decoder) != DECODE_COMMAND_NONE)) return -1; if (ret == DECODE_SKIP) continue; while ((ret = decodeNextFrame(data)) == DECODE_CONT && - (!decoder || decoder_get_command(decoder) != DECODE_COMMAND_STOP)); + (!decoder || decoder_get_command(decoder) == DECODE_COMMAND_NONE)); if (ret == DECODE_BREAK || - (decoder && decoder_get_command(decoder) == DECODE_COMMAND_STOP)) + (decoder && decoder_get_command(decoder) != DECODE_COMMAND_NONE)) return -1; if (ret == DECODE_OK) break; } @@ -990,7 +990,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) while ((ret = decodeNextFrameHeader(data, NULL, replayGainInfo)) == DECODE_CONT - && decoder_get_command(decoder) != DECODE_COMMAND_STOP) ; + && decoder_get_command(decoder) == DECODE_COMMAND_NONE) ; if (ret == DECODE_BREAK || decoder_get_command(decoder) != DECODE_COMMAND_NONE) break; else if (ret == DECODE_SKIP) @@ -1006,7 +1006,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) break; } - if (decoder_get_command(decoder) == DECODE_COMMAND_STOP) + if (decoder_get_command(decoder) != DECODE_COMMAND_NONE) return DECODE_BREAK; return ret; @@ -1029,7 +1029,7 @@ static int mp3_decode(struct decoder * decoder, InputStream * inStream) if (openMp3FromInputStream(inStream, &data, decoder, &tag, &replayGainInfo) < 0) { - if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) { + if (decoder_get_command(decoder) == DECODE_COMMAND_NONE) { ERROR ("Input does not appear to be a mp3 bit stream.\n"); return -1; -- cgit v1.2.3