aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:15 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:15 +0200
commite530181e233f315f90c31e0d4aae63449222f46c (patch)
tree43b10597e3472d2edfa05250fc11f746a6d27f4a /src/inputPlugins
parent4515ac5ecbab8cdb0a92e3873a54238f901757c2 (diff)
downloadmpd-e530181e233f315f90c31e0d4aae63449222f46c.tar.gz
mpd-e530181e233f315f90c31e0d4aae63449222f46c.tar.xz
mpd-e530181e233f315f90c31e0d4aae63449222f46c.zip
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.
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/flac_plugin.c2
-rw-r--r--src/inputPlugins/mp3_plugin.c14
-rw-r--r--src/inputPlugins/oggflac_plugin.c6
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c3
-rw-r--r--src/inputPlugins/wavpack_plugin.c2
5 files changed, 14 insertions, 13 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index aeea17023..06994d3dd 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -36,7 +36,7 @@ static flac_read_status flacRead(mpd_unused const flac_decoder * flacDec,
r = decoder_read(data->decoder, data->inStream, (void *)buf, *bytes);
*bytes = r;
- if (r == 0 && decoder_get_command(data->decoder) != DECODE_COMMAND_STOP) {
+ if (r == 0 && decoder_get_command(data->decoder) == DECODE_COMMAND_NONE) {
if (inputStreamAtEOF(data->inStream))
return flac_read_status_eof;
else
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;
diff --git a/src/inputPlugins/oggflac_plugin.c b/src/inputPlugins/oggflac_plugin.c
index f56a6b5ec..2adbaed60 100644
--- a/src/inputPlugins/oggflac_plugin.c
+++ b/src/inputPlugins/oggflac_plugin.c
@@ -51,7 +51,7 @@ static OggFLAC__SeekableStreamDecoderReadStatus of_read_cb(const
*bytes = r;
if (r == 0 && !inputStreamAtEOF(data->inStream) &&
- decoder_get_command(data->decoder) != DECODE_COMMAND_STOP)
+ decoder_get_command(data->decoder) == DECODE_COMMAND_NONE)
return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
return OggFLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
@@ -365,14 +365,14 @@ static int oggflac_decode(struct decoder * mpd_decoder, InputStream * inStream)
}
}
- if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
+ if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_NONE) {
oggflacPrintErroredState
(OggFLAC__seekable_stream_decoder_get_state(decoder));
OggFLAC__seekable_stream_decoder_finish(decoder);
}
/* send last little bit */
if (data.chunk_length > 0 &&
- decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP) {
+ decoder_get_command(mpd_decoder) == DECODE_COMMAND_NONE) {
flacSendChunk(&data);
decoder_flush(mpd_decoder);
}
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index b2aa8bf60..808af92b0 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -319,7 +319,8 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
}
}
- if (decoder_get_command(decoder) != DECODE_COMMAND_STOP && chunkpos > 0) {
+ if (decoder_get_command(decoder) == DECODE_COMMAND_NONE &&
+ chunkpos > 0) {
decoder_data(decoder, NULL, inStream->seekable,
chunk, chunkpos,
ov_time_tell(&vf), bitRate,
diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c
index e4ac8b1e7..7a37e69b2 100644
--- a/src/inputPlugins/wavpack_plugin.c
+++ b/src/inputPlugins/wavpack_plugin.c
@@ -487,7 +487,7 @@ static int wavpack_open_wvc(struct decoder *decoder,
if (bufferInputStream(is_wvc) >= 0)
return 1;
- if (decoder_get_command(decoder) == DECODE_COMMAND_STOP) {
+ if (decoder_get_command(decoder) != DECODE_COMMAND_NONE) {
closeInputStream(is_wvc);
return 0;
}