summaryrefslogtreecommitdiff
path: root/src/song.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/song.c
parent995a5deb285385417bc7d6ab182313088c62b9ca (diff)
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/song.c')
-rw-r--r--src/song.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/song.c b/src/song.c
index 377487cbd..c7186d1e0 100644
--- a/src/song.c
+++ b/src/song.c
@@ -57,32 +57,32 @@ Song * newSong(char * utf8file) {
song->utf8file = strdup(utf8file);
- if(0);
+ if(!isFile(utf8file,&(song->mtime)));
#ifdef HAVE_OGG
- else if(isOgg(utf8file,&(song->mtime))) {
+ else if(hasOggSuffix(utf8file)) {
song->tag = oggTagDup(utf8file);
}
#endif
#ifdef HAVE_FLAC
- else if((isFlac(utf8file,&(song->mtime)))) {
+ else if((hasFlacSuffix(utf8file))) {
song->tag = flacTagDup(utf8file);
}
#endif
#ifdef HAVE_MAD
- else if(isMp3(utf8file,&(song->mtime))) {
+ else if(hasMp3Suffix(utf8file)) {
song->tag = mp3TagDup(utf8file);
}
#endif
#ifdef HAVE_AUDIOFILE
- else if(isWave(utf8file,&(song->mtime))) {
+ else if(hasWaveSuffix(utf8file)) {
song->tag = audiofileTagDup(utf8file);
}
#endif
#ifdef HAVE_FAAD
- else if(isAac(utf8file,&(song->mtime))) {
+ else if(hasAacSuffix(utf8file)) {
song->tag = aacTagDup(utf8file);
}
- else if(isMp4(utf8file,&(song->mtime))) {
+ else if(hasMp4Suffix(utf8file)) {
song->tag = mp4TagDup(utf8file);
}
#endif
@@ -227,32 +227,32 @@ int updateSongInfo(Song * song) {
song->tag = NULL;
- if(0);
+ if(!isFile(utf8file,&(song->mtime)));
#ifdef HAVE_OGG
- else if(isOgg(utf8file,&(song->mtime))) {
+ else if(hasOggSuffix(utf8file)) {
song->tag = oggTagDup(utf8file);
}
#endif
#ifdef HAVE_FLAC
- else if((isFlac(utf8file,&(song->mtime)))) {
+ else if((hasFlacSuffix(utf8file))) {
song->tag = flacTagDup(utf8file);
}
#endif
#ifdef HAVE_MAD
- else if(isMp3(utf8file,&(song->mtime))) {
+ else if(hasMp3Suffix(utf8file)) {
song->tag = mp3TagDup(utf8file);
}
#endif
#ifdef HAVE_AUDIOFILE
- else if(isWave(utf8file,&(song->mtime))) {
+ else if(hasWaveSuffix(utf8file)) {
song->tag = audiofileTagDup(utf8file);
}
#endif
#ifdef HAVE_FAAD
- else if(isAac(utf8file,&(song->mtime))) {
+ else if(hasAacSuffix(utf8file)) {
song->tag = aacTagDup(utf8file);
}
- else if(isMp4(utf8file,&(song->mtime))) {
+ else if(hasMp4Suffix(utf8file)) {
song->tag = mp4TagDup(utf8file);
}
#endif