[totem-pl-parser] pla: playlist-ended expects a URI, not a title
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] pla: playlist-ended expects a URI, not a title
- Date: Wed, 20 Mar 2013 11:12:54 +0000 (UTC)
commit ec255a8148714860f2637c3b42fbec7ff3554359
Author: Bastien Nocera <hadess hadess net>
Date: Wed Mar 20 11:37:45 2013 +0100
pla: playlist-ended expects a URI, not a title
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]