diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-03-17 03:10:17 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-03-17 03:10:17 +0000 |
commit | f114fbd437dc4f767d85b9f429adf3a3eb9b943f (patch) | |
tree | c6a4a83596498787c7457998ad4d22d93cad1796 /src/ls.c | |
parent | 0f11ce855e1cd4949d2c5db9c3f616b7be201b11 (diff) | |
download | mpd-f114fbd437dc4f767d85b9f429adf3a3eb9b943f.tar.gz mpd-f114fbd437dc4f767d85b9f429adf3a3eb9b943f.tar.xz mpd-f114fbd437dc4f767d85b9f429adf3a3eb9b943f.zip |
fix a few snafoo's in configure.ac
Add initial stuff for AAC support, now we just need to write the decoder
git-svn-id: https://svn.musicpd.org/mpd/trunk@264 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/ls.c | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -125,6 +125,9 @@ int isMusic(char * utf8file, time_t * mtime) { #ifdef HAVE_AUDIOFILE if((ret = isWave(utf8file,mtime))) return ret; #endif +#ifdef HAVE_FAAD + if((ret = isAac(utf8file,mtime))) return ret; +#endif return ret; } @@ -246,6 +249,35 @@ int isOgg(char * utf8file, time_t * mtime) { return 0; } +int isAac(char * utf8file, time_t * mtime) { + struct stat st; + char * file = utf8ToFsCharset(utf8file); + char * actualFile = file; + + if(actualFile[0]!='/') actualFile = rmp2amp(file); + + if(stat(actualFile,&st)==0) { + if(S_ISREG(st.st_mode)) { + char * dup; + char * cLast; + char * cNext; + int ret = 0; + dup = strdup(file); + cNext = cLast = strtok(dup,"."); + while((cNext = strtok(NULL,"."))) cLast = cNext; + if(cLast && 0==strcasecmp(cLast,"aac")) { + if(mtime) *mtime = st.st_mtime; + ret = 1; + } + free(dup); + return ret; + } + else return 0; + } + + return 0; +} + int isMp3(char * utf8file, time_t * mtime) { struct stat st; char * file = utf8ToFsCharset(utf8file); |