From 3e9705815108dd25b2f9f77fbd77bbcbb3340d69 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 11 Mar 2020 20:54:53 +0100 Subject: [PATCH] playlist/xspf: move location.empty() check to _start_element() --- src/playlist/plugins/XspfPlaylistPlugin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/playlist/plugins/XspfPlaylistPlugin.cxx b/src/playlist/plugins/XspfPlaylistPlugin.cxx index b084725fe..f32dc35d4 100644 --- a/src/playlist/plugins/XspfPlaylistPlugin.cxx +++ b/src/playlist/plugins/XspfPlaylistPlugin.cxx @@ -107,7 +107,7 @@ xspf_start_element(void *user_data, const XML_Char *element_name, case XspfParser::TRACK: if (strcmp(element_name, "location") == 0) parser->state = XspfParser::LOCATION; - else + else if (!parser->location.empty()) parser->tag_type = tag_table_lookup(xspf_tag_elements, element_name); @@ -169,8 +169,7 @@ xspf_char_data(void *user_data, const XML_Char *s, int len) break; case XspfParser::TRACK: - if (!parser->location.empty() && - parser->tag_type != TAG_NUM_OF_ITEM_TYPES) + if (parser->tag_type != TAG_NUM_OF_ITEM_TYPES) parser->tag_builder.AddItem(parser->tag_type, StringView(s, len));