aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2005-12-31 04:11:08 +0000
committerEric Wong <normalperson@yhbt.net>2005-12-31 04:11:08 +0000
commitb08ab529940b9af125b9292e6866af10d7a8ae32 (patch)
treed48ccb0eafe69d6f47fb25f0438f7c2e9d7338c4
parentea5d367ecf00f9ac4a5e8f0d8cc8909538f42640 (diff)
downloadmpd-b08ab529940b9af125b9292e6866af10d7a8ae32.tar.gz
mpd-b08ab529940b9af125b9292e6866af10d7a8ae32.tar.xz
mpd-b08ab529940b9af125b9292e6866af10d7a8ae32.zip
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
-rw-r--r--src/decode.c3
1 files changed, 3 insertions, 0 deletions
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);