From 2cc59816a6e6304e643bc5c7ca055dd2567cba9e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Jan 2008 10:09:56 +0000 Subject: 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 --- src/inputPlugins/aac_plugin.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/inputPlugins/aac_plugin.c') diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index 89095ef82..0cbb4c97a 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -337,7 +337,6 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) if (bread < 0) { ERROR("Error not a AAC stream.\n"); faacDecClose(decoder); - closeInputStream(b.inStream); if (b.buffer) free(b.buffer); return -1; @@ -413,7 +412,6 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) flushOutputBuffer(cb); faacDecClose(decoder); - closeInputStream(b.inStream); if (b.buffer) free(b.buffer); @@ -425,12 +423,6 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) dc->seek = 0; } - if (dc->stop) { - dc->state = DECODE_STATE_STOP; - dc->stop = 0; - } else - dc->state = DECODE_STATE_STOP; - return 0; } -- cgit v1.2.3