aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2005-12-05 03:53:56 +0000
committerEric Wong <normalperson@yhbt.net>2005-12-05 03:53:56 +0000
commit7a7886a193d4d2ecdf092bbd18e37739f2430be5 (patch)
tree9d5cf3b78e50803ec9d26d1ef6b2a36561d6fb34 /src/song.c
parent3af3a551dfbd3299287b88980370de9dc98308fc (diff)
downloadmpd-7a7886a193d4d2ecdf092bbd18e37739f2430be5.tar.gz
mpd-7a7886a193d4d2ecdf092bbd18e37739f2430be5.tar.xz
mpd-7a7886a193d4d2ecdf092bbd18e37739f2430be5.zip
OggFLAC support
git-svn-id: https://svn.musicpd.org/mpd/branches/oggflac@3720 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/song.c')
-rw-r--r--src/song.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/song.c b/src/song.c
index 9a2c8d67d..07a7e04fb 100644
--- a/src/song.c
+++ b/src/song.c
@@ -64,9 +64,12 @@ Song * newSong(char * url, int type, Directory * parentDir) {
if(song->type == SONG_TYPE_FILE) {
InputPlugin * plugin;
- if((plugin = isMusic(getSongUrl(song), &(song->mtime)))) {
- song->tag = plugin->tagDupFunc(
- rmp2amp(utf8ToFsCharset(getSongUrl(song))));
+ unsigned int next = 0;
+ char * song_url = getSongUrl(song);
+ char * abs_path = rmp2amp(utf8ToFsCharset(song_url));
+ while(!song->tag && (plugin = isMusic(song_url,
+ &(song->mtime), next++))) {
+ song->tag = plugin->tagDupFunc(abs_path);
}
if(!song->tag || song->tag->time<0) {
freeSong(song);
@@ -100,7 +103,7 @@ Song * addSongToList(SongList * list, char * url, char * utf8path,
switch(songType) {
case SONG_TYPE_FILE:
- if(isMusic(utf8path, NULL)) {
+ if(isMusic(utf8path, NULL, 0)) {
song = newSong(url, songType, parentDirectory);
}
break;
@@ -278,14 +281,17 @@ void readSongInfoIntoList(FILE * fp, SongList * list, Directory * parentDir) {
int updateSongInfo(Song * song) {
if(song->type == SONG_TYPE_FILE) {
InputPlugin * plugin;
+ unsigned int next = 0;
+ char * song_url = getSongUrl(song);
+ char * abs_path = rmp2amp(song_url);
if(song->tag) freeMpdTag(song->tag);
song->tag = NULL;
- if((plugin = isMusic(getSongUrl(song),&(song->mtime)))) {
- song->tag = plugin->tagDupFunc(
- rmp2amp(getSongUrl(song)));
+ while(!song->tag && (plugin = isMusic(song_url,
+ &(song->mtime), next++))) {
+ song->tag = plugin->tagDupFunc(abs_path);
}
if(!song->tag || song->tag->time<0) return -1;
}