Simplify decode cleanup logic a bit

DECODE_STATE_STOP is always set as dc->state, and dc->stop
is always cleared.  So handle it in decodeStart once rather
than doing it in every plugin.

While we're at it, fix a long-standing (but difficult to
trigger) bug in mpc_decode where we failed to return
if mpc_decoder_initialize() fails.

git-svn-id: https://svn.musicpd.org/mpd/trunk@7122 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong
2008-01-01 10:09:56 +00:00
parent 5e7367c580
commit 2cc59816a6
11 changed files with 21 additions and 126 deletions

View File

@@ -410,14 +410,6 @@ static int flac_decode_internal(OutputBuffer * cb, DecoderControl * dc,
flushOutputBuffer(data.cb);
}
/*if(dc->seek) {
dc->seekError = 1;
dc->seek = 0;
} */
dc->state = DECODE_STATE_STOP;
dc->stop = 0;
fail:
if (data.replayGainInfo)
freeReplayGainInfo(data.replayGainInfo);
@@ -425,8 +417,6 @@ fail:
if (flacDec)
flac_delete(flacDec);
closeInputStream(inStream);
if (err) {
ERROR("flac %s\n", err);
return -1;