[vlc-commits] demux: playlist: fix broken m3u logic (fix #18544)

Francois Cartegnie git at videolan.org
Mon Jul 17 20:50:48 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jul 17 20:46:20 2017 +0200| [52d25d6de50cb5e1e50404a15194788a0e71fd0b] | committer: Francois Cartegnie

demux: playlist: fix broken m3u logic (fix #18544)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=52d25d6de50cb5e1e50404a15194788a0e71fd0b
---

 modules/demux/playlist/m3u.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index a7744df0d7..ea003d487e 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -114,17 +114,18 @@ int Import_M3U( vlc_object_t *p_this )
      && !vlc_ascii_strcasecmp(type, "application/vnd.apple.mpegurl")) /* HLS */
         match = false;
     else
-    if (stream_HasExtension(p_stream, ".m3u8")
-     || stream_HasExtension(p_stream, ".m3u")
-     || (type != NULL && vlc_ascii_strcasecmp(type, "audio/mpegurl") == 0))
-        match = !IsHLS(p_peek, i_peek);
-    else
     if (memcmp(p_peek, "#EXTM3U", 7 ) == 0
-     || stream_HasExtension(p_stream, ".vlc")
      || (type != NULL
       && (vlc_ascii_strcasecmp(type, "application/mpegurl") == 0
        || vlc_ascii_strcasecmp(type, "application/x-mpegurl") == 0
+       || vlc_ascii_strcasecmp(type, "audio/mpegurl") == 0
+       || vlc_ascii_strcasecmp(type, "vnd.apple.mpegURL") == 0
        || vlc_ascii_strcasecmp(type, "audio/x-mpegurl") == 0))
+     || stream_HasExtension(p_stream, ".m3u8")
+     || stream_HasExtension(p_stream, ".m3u"))
+        match = !IsHLS(p_peek, i_peek);
+    else
+    if (stream_HasExtension(p_stream, ".vlc")
      || strncasecmp((const char *)p_peek, "RTSPtext", 8) == 0
      || ContainsURL(p_peek, i_peek))
         match = true;



More information about the vlc-commits mailing list