aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-20 04:32:38 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-20 04:32:38 +0000
commit0b051094166ad33184100f229931ea0f6f21e176 (patch)
tree3735e311736b4e72b831d59fbeaf48ce008c621e /src/decode.c
parent05889aa3e337ac264c185dd60cec5e5071fe0a31 (diff)
downloadmpd-0b051094166ad33184100f229931ea0f6f21e176.tar.gz
mpd-0b051094166ad33184100f229931ea0f6f21e176.tar.xz
mpd-0b051094166ad33184100f229931ea0f6f21e176.zip
more bug fixes
git-svn-id: https://svn.musicpd.org/mpd/trunk@1108 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/decode.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/decode.c b/src/decode.c
index 82865b39b..86f0fc69b 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -251,6 +251,8 @@ int decodeSeek(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb,
void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
int ret;
InputStream inStream;
+ int suffix = pc->fileSuffix;
+ int decodeType = pc->decodeType;
strncpy(dc->file,pc->file,MAXPATHLEN);
dc->file[MAXPATHLEN] = '\0';
@@ -275,10 +277,10 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
return;
}
- switch(pc->decodeType) {
+ switch(decodeType) {
case DECODE_TYPE_URL:
#ifdef HAVE_OGG
- if(pc->fileSuffix == DECODE_SUFFIX_OGG || (inStream.mime &&
+ if(suffix == DECODE_SUFFIX_OGG || (inStream.mime &&
0 == strcmp(inStream.mime, "application/ogg")))
{
ret = ogg_decode(cb, dc, &inStream);
@@ -286,7 +288,7 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
}
#endif
#ifdef HAVE_MAD
- /*if(pc->fileSuffix == DECODE_SUFFIX_MP3 || (inStream.mime &&
+ /*if(fileSuffix == DECODE_SUFFIX_MP3 || (inStream.mime &&
0 == strcmp(inStream.mime, "audio/mpeg")))*/
{
ret = mp3_decode(cb,dc,&inStream);
@@ -296,38 +298,38 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
#endif
case DECODE_TYPE_FILE:
#ifdef HAVE_MAD
- if(pc->fileSuffix == DECODE_SUFFIX_MP3) {
+ if(suffix == DECODE_SUFFIX_MP3) {
ret = mp3_decode(cb, dc, &inStream);
break;
}
#endif
#ifdef HAVE_OGG
- if(pc->fileSuffix == DECODE_SUFFIX_OGG) {
+ if(suffix == DECODE_SUFFIX_OGG) {
ret = ogg_decode(cb, dc, &inStream);
break;
}
#endif
#ifdef HAVE_FAAD
- if(pc->fileSuffix == DECODE_SUFFIX_AAC) {
+ if(suffix == DECODE_SUFFIX_AAC) {
closeInputStream(&inStream);
ret = aac_decode(cb,dc);
break;
}
- if(pc->fileSuffix == DECODE_SUFFIX_MP4) {
+ if(suffix == DECODE_SUFFIX_MP4) {
closeInputStream(&inStream);
ret = mp4_decode(cb,dc);
break;
}
#endif
#ifdef HAVE_FLAC
- if(pc->fileSuffix == DECODE_SUFFIX_FLAC) {
+ if(suffix == DECODE_SUFFIX_FLAC) {
closeInputStream(&inStream);
ret = flac_decode(cb,dc);
break;
}
#endif
#ifdef HAVE_AUDIOFILE
- if(pc->fileSuffix == DECODE_SUFFIX_WAVE) {
+ if(suffix == DECODE_SUFFIX_WAVE) {
closeInputStream(&inStream);
ret = audiofile_decode(cb,dc);
break;