From b08ab529940b9af125b9292e6866af10d7a8ae32 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 31 Dec 2005 04:11:08 +0000 Subject: r1072@BL4ST: normalperson | 2005-12-30 20:10:46 -0800 decode: prevent calling streamDecodeFunc twice on failure if streamDecodeFunc runs, it will close the InputStream we're using, regardless of whether or not it was successful. git-svn-id: https://svn.musicpd.org/mpd/branches/oggflac@3755 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/decode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/decode.c') diff --git a/src/decode.c b/src/decode.c index ccca3b204..146f5a974 100644 --- a/src/decode.c +++ b/src/decode.c @@ -336,6 +336,7 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) { &inStream)) continue; ret = plugin->streamDecodeFunc(cb, dc, &inStream); + break; } /* if that fails, try suffix matching the URL: */ @@ -355,6 +356,7 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) { continue; ret = plugin->streamDecodeFunc( cb, dc, &inStream); + break; } } /* fallback to mp3: */ @@ -382,6 +384,7 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) { if(plugin->streamDecodeFunc) { ret = plugin->streamDecodeFunc( cb, dc, &inStream); + break; } else if(plugin->fileDecodeFunc) { closeInputStream(&inStream); -- cgit v1.2.3