diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-03-31 22:32:44 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-03-31 22:32:44 +0000 |
commit | 795a1e930b6d3d606546689e991149b9ad583066 (patch) | |
tree | bee338e390d2a971f667acba81cadf26d2c2c685 /src/player.c | |
parent | 995a5deb285385417bc7d6ab182313088c62b9ca (diff) | |
download | mpd-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.c | 14 |
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; } |