aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-31 22:32:44 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-31 22:32:44 +0000
commit795a1e930b6d3d606546689e991149b9ad583066 (patch)
treebee338e390d2a971f667acba81cadf26d2c2c685 /src/player.c
parent995a5deb285385417bc7d6ab182313088c62b9ca (diff)
downloadmpd-795a1e930b6d3d606546689e991149b9ad583066.tar.gz
mpd-795a1e930b6d3d606546689e991149b9ad583066.tar.xz
mpd-795a1e930b6d3d606546689e991149b9ad583066.zip
lets cleanup some file type detection and not call stat() so much
git-svn-id: https://svn.musicpd.org/mpd/trunk@575 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/player.c b/src/player.c
index 19693c2c3..138a54a49 100644
--- a/src/player.c
+++ b/src/player.c
@@ -150,22 +150,22 @@ int playerInit() {
}
int playerGetDecodeType(char * utf8file) {
- if(0);
+ if(!isFile(utf8file,NULL));
#ifdef HAVE_MAD
- if(isMp3(utf8file,NULL)) return DECODE_TYPE_MP3;
+ else if(hasMp3Suffix(utf8file)) return DECODE_TYPE_MP3;
#endif
#ifdef HAVE_OGG
- if(isOgg(utf8file,NULL)) return DECODE_TYPE_OGG;
+ else if(hasOggSuffix(utf8file)) return DECODE_TYPE_OGG;
#endif
#ifdef HAVE_FLAC
- if(isFlac(utf8file,NULL)) return DECODE_TYPE_FLAC;
+ else if(hasFlacSuffix(utf8file)) return DECODE_TYPE_FLAC;
#endif
#ifdef HAVE_AUDIOFILE
- if(isWave(utf8file,NULL)) return DECODE_TYPE_AUDIOFILE;
+ else if(hasWaveSuffix(utf8file)) return DECODE_TYPE_AUDIOFILE;
#endif
#ifdef HAVE_FAAD
- if(isAac(utf8file,NULL)) return DECODE_TYPE_AAC;
- if(isMp4(utf8file,NULL)) return DECODE_TYPE_MP4;
+ else if(hasAacSuffix(utf8file)) return DECODE_TYPE_AAC;
+ else if(hasMp4Suffix(utf8file)) return DECODE_TYPE_MP4;
#endif
return -1;
}