playlist/xspf: move location.empty() check to _start_element()

This commit is contained in:
Max Kellermann 2020-03-11 20:54:53 +01:00
parent 51b1dd8672
commit 3e97058151

View File

@ -107,7 +107,7 @@ xspf_start_element(void *user_data, const XML_Char *element_name,
case XspfParser::TRACK: case XspfParser::TRACK:
if (strcmp(element_name, "location") == 0) if (strcmp(element_name, "location") == 0)
parser->state = XspfParser::LOCATION; parser->state = XspfParser::LOCATION;
else else if (!parser->location.empty())
parser->tag_type = tag_table_lookup(xspf_tag_elements, parser->tag_type = tag_table_lookup(xspf_tag_elements,
element_name); element_name);
@ -169,8 +169,7 @@ xspf_char_data(void *user_data, const XML_Char *s, int len)
break; break;
case XspfParser::TRACK: case XspfParser::TRACK:
if (!parser->location.empty() && if (parser->tag_type != TAG_NUM_OF_ITEM_TYPES)
parser->tag_type != TAG_NUM_OF_ITEM_TYPES)
parser->tag_builder.AddItem(parser->tag_type, parser->tag_builder.AddItem(parser->tag_type,
StringView(s, len)); StringView(s, len));