[totem-pl-parser] lines: Add playlist-started/ended support for M3U files



commit 6f7001fec750f9d41392ff99b1296f356f7142eb
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 20 11:49:48 2013 +0100

    lines: Add playlist-started/ended support for M3U files

 plparse/totem-pl-parser-lines.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/plparse/totem-pl-parser-lines.c b/plparse/totem-pl-parser-lines.c
index df1737a..7cae0d7 100644
--- a/plparse/totem-pl-parser-lines.c
+++ b/plparse/totem-pl-parser-lines.c
@@ -346,6 +346,7 @@ totem_pl_parser_add_m3u (TotemPlParser *parser,
        guint i, num_lines;
        gboolean dos_mode = FALSE;
        const char *extinfo;
+       char *pl_uri;
 
        if (g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) == FALSE)
                return TOTEM_PL_PARSER_RESULT_ERROR;
@@ -384,6 +385,13 @@ totem_pl_parser_add_m3u (TotemPlParser *parser,
        /* We don't count the terminating NULL */
        num_lines--;
 
+       /* Send out the playlist start and get crackin' */
+       pl_uri = g_file_get_uri (file);
+       totem_pl_parser_add_uri (parser,
+                                TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE,
+                                TOTEM_PL_PARSER_FIELD_URI, pl_uri,
+                                NULL);
+
        for (i = 0; lines[i] != NULL; i++) {
                const char *line;
 
@@ -465,6 +473,9 @@ totem_pl_parser_add_m3u (TotemPlParser *parser,
 
        g_strfreev (lines);
 
+       totem_pl_parser_playlist_end (parser, pl_uri);
+       g_free (pl_uri);
+
        return retval;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]