diff options
author | Max Kellermann <max@duempel.org> | 2009-01-04 17:26:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-04 17:26:22 +0100 |
commit | ff72fff68da8edc9d28e0022425893d1641f21e5 (patch) | |
tree | 2ef8847032fddb93823e0b30c872c51a25c9ab75 /src/update.c | |
parent | d6b229e35c87cb246fcb77b2b04ac65adccc2b31 (diff) | |
download | mpd-ff72fff68da8edc9d28e0022425893d1641f21e5.tar.gz mpd-ff72fff68da8edc9d28e0022425893d1641f21e5.tar.xz mpd-ff72fff68da8edc9d28e0022425893d1641f21e5.zip |
ls: removed hasMusicSuffix() and get_archive_by_suffix()
Determine the suffix manually, and use decoder_plugin_from_suffix()
and archive_plugin_from_suffix() instead.
This way, song_file_update_inarchive() can be optimized: it does not
have to translate its path.
Diffstat (limited to '')
-rw-r--r-- | src/update.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/update.c b/src/update.c index 826a17dc7..0cf73ff80 100644 --- a/src/update.c +++ b/src/update.c @@ -24,6 +24,7 @@ #include "ls.h" #include "mapper.h" #include "path.h" +#include "decoder_list.h" #include "playlist.h" #include "event_pipe.h" #include "condition.h" @@ -351,7 +352,12 @@ static void update_regular_file(struct directory *directory, const char *name, const struct stat *st) { - if (hasMusicSuffix(name, 0)) { + const char *suffix = getSuffix(name); + + if (suffix == NULL) + return; + + if (decoder_plugin_from_suffix(suffix, false) != NULL) { struct song *song = songvec_find(&directory->songs, name); if (song == NULL) { @@ -371,7 +377,7 @@ update_regular_file(struct directory *directory, modified = true; } #ifdef ENABLE_ARCHIVE - } else if ((archive = get_archive_by_suffix(name))) { + } else if ((archive = archive_plugin_from_suffix(suffix))) { struct archive_file *archfile; char pathname[MPD_PATH_MAX]; |