diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-03-20 11:37:45 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-03-20 12:11:37 +0100 |
commit | ec255a8148714860f2637c3b42fbec7ff3554359 (patch) | |
tree | edd074a913bcf4ef73e0fca97ef54cc5173b2e67 /plparse/totem-pl-parser-pla.c | |
parent | 80ed94e669236f25c5ebb836a462c0c40b1c6a3a (diff) | |
download | totem-pl-parser-ec255a8148714860f2637c3b42fbec7ff3554359.tar.gz |
pla: playlist-ended expects a URI, not a title
Diffstat (limited to 'plparse/totem-pl-parser-pla.c')
-rw-r--r-- | plparse/totem-pl-parser-pla.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plparse/totem-pl-parser-pla.c b/plparse/totem-pl-parser-pla.c index 3d508ff..049d8ce 100644 --- a/plparse/totem-pl-parser-pla.c +++ b/plparse/totem-pl-parser-pla.c @@ -171,7 +171,7 @@ totem_pl_parser_add_pla (TotemPlParser *parser, gpointer data) { TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED; - char *contents, *title; + char *contents, *title, *uri; guint offset, max_entries, entry; gsize size; @@ -197,19 +197,18 @@ totem_pl_parser_add_pla (TotemPlParser *parser, /* read playlist title starting at offset 32 */ title = NULL; if (contents[TITLE_OFFSET] != '\0') - { title = contents + TITLE_OFFSET; - totem_pl_parser_add_uri (parser, - TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE, - TOTEM_PL_PARSER_FIELD_FILE, file, - TOTEM_PL_PARSER_FIELD_TITLE, title, - NULL); - } + + totem_pl_parser_add_uri (parser, + TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE, + TOTEM_PL_PARSER_FIELD_FILE, file, + TOTEM_PL_PARSER_FIELD_TITLE, title, + NULL); offset = RECORD_SIZE; entry = 0; while (offset + RECORD_SIZE <= size && entry < max_entries) { - char *path, *uri; + char *path; GError *error = NULL; /* path starts at +2, is at most 500 bytes, in big-endian utf16 .. */ @@ -246,8 +245,9 @@ totem_pl_parser_add_pla (TotemPlParser *parser, entry++; } - if (title != NULL) - totem_pl_parser_playlist_end (parser, title); + uri = g_file_get_uri (file); + totem_pl_parser_playlist_end (parser, uri); + g_free (uri); g_free (contents); |