From 5395f5f6b34b6a98e94c8f3e8329150a2a4b9cac Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 17 Jan 2009 13:23:42 +0100 Subject: moved fallback APE/ID3 tag loader to song.c Some plugins used the APE or ID3 tag loader as a fallback when their own methods of loading tags did not work. Move this code out of all decoder plugins, into song_file_update(). --- src/decoder/mp3_plugin.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/decoder/mp3_plugin.c') diff --git a/src/decoder/mp3_plugin.c b/src/decoder/mp3_plugin.c index 3444a7e94..fd0ac21a9 100644 --- a/src/decoder/mp3_plugin.c +++ b/src/decoder/mp3_plugin.c @@ -19,6 +19,7 @@ #include "../decoder_api.h" #include "../conf.h" #include "config.h" +#include "tag_id3.h" #include #include @@ -1190,22 +1191,19 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream) static struct tag *mp3_tag_dup(const char *file) { - struct tag *ret = NULL; + struct tag *tag; int total_time; - ret = tag_id3_load(file); - total_time = mp3_total_file_time(file); - if (total_time >= 0) { - if (!ret) - ret = tag_new(); - ret->time = total_time; - } else { + if (total_time < 0) { g_debug("mp3_tag_dup: Failed to get total song time from: %s\n", file); + return NULL; } - return ret; + tag = tag_new(); + tag->time = total_time; + return tag; } static const char *const mp3_suffixes[] = { "mp3", "mp2", NULL }; -- cgit v1.2.3