[totem-pl-parser] plparse: Fix parsing of local HLS playlists



commit 4f15fe102858b3a9ca12158d14e078b8383bed0c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 15 15:49:16 2015 +0100

    plparse: Fix parsing of local HLS playlists
    
    Local HLS playlists will have their mime-type already set to the one
    gathered through magic because of its locality. As the
    application/vnd.apple.mpegurl mime-type descends from text/plain, it
    will be ignored (as it shouldn't be needed to go through the M3U parser
    for it) instead of unhandled.
    
    Fix this, and one of our tests, by checking for that playlist type.

 plparse/totem-pl-parser-private.h |    1 +
 plparse/totem-pl-parser.c         |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plparse/totem-pl-parser-private.h b/plparse/totem-pl-parser-private.h
index 48c8923..8073ec7 100644
--- a/plparse/totem-pl-parser-private.h
+++ b/plparse/totem-pl-parser-private.h
@@ -80,6 +80,7 @@
 #define QUICKTIME_META_MIME_TYPE "application/x-quicktime-media-link"
 #define ASX_MIME_TYPE "audio/x-ms-asx"
 #define ASF_REF_MIME_TYPE "application/vnd.ms-asf"
+#define HLS_MIME_TYPE "application/vnd.apple.mpegurl"
 
 #define TOTEM_PL_PARSER_FIELD_FILE             "gfile-object"
 #define TOTEM_PL_PARSER_FIELD_BASE_FILE                "gfile-object-base"
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index ce425c3..93fa451 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1890,6 +1890,10 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
                g_free (data);
                g_free (mimetype);
                return TOTEM_PL_PARSER_RESULT_SUCCESS;
+       } else if (strcmp (mimetype, HLS_MIME_TYPE) == 0) {
+               g_free (data);
+               g_free (mimetype);
+               return TOTEM_PL_PARSER_RESULT_UNHANDLED;
        }
 
        /* If we're at the top-level of the parsing, try to get more


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