diff options
author | Bastien Nocera <hadess@hadess.net> | 2010-06-01 18:49:33 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2010-06-01 18:50:49 +0100 |
commit | f5c6405416ae14841e72828ba6220836395509bd (patch) | |
tree | e6e44c4d20a44517f7b8aa8bbe1a04bbb3bd8f57 | |
parent | 234749a7e9fe84aeec358a9958cb0d25975d5aed (diff) | |
download | totem-pl-parser-f5c6405416ae14841e72828ba6220836395509bd.tar.gz |
Fix PLS parsing when some numbered entries are missing
Fix missing entries when parsing a PLS file which has "holes"
in its numbering.
-rw-r--r-- | plparse/totem-pl-parser-pls.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plparse/totem-pl-parser-pls.c b/plparse/totem-pl-parser-pls.c index 50b5e68..4a3ef9e 100644 --- a/plparse/totem-pl-parser-pls.c +++ b/plparse/totem-pl-parser-pls.c @@ -172,6 +172,7 @@ totem_pl_parser_add_pls_with_contents (TotemPlParser *parser, char *playlist_title; gboolean fallback; GHashTable *entries; + guint found_entries; entries = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); @@ -241,7 +242,8 @@ totem_pl_parser_add_pls_with_contents (TotemPlParser *parser, retval = TOTEM_PL_PARSER_RESULT_SUCCESS; - for (i = 1; i <= num_entries; i++) { + found_entries = 0; + for (i = 1; found_entries < num_entries; i++) { char *file_str, *title, *genre, *length; char *file_key, *title_key, *genre_key, *length_key; gint64 length_num; @@ -265,6 +267,7 @@ totem_pl_parser_add_pls_with_contents (TotemPlParser *parser, if (file_str == NULL) continue; + found_entries++; fallback = parse_data->fallback; if (parse_data->recurse) |