]> git.sesse.net Git - vlc/commitdiff
m3u8: correctly deal with BOM (fixes #8859)
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 24 Jun 2013 15:52:10 +0000 (18:52 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 24 Jun 2013 15:52:10 +0000 (18:52 +0300)
75a167f5b377a1edba3e1bf0230af05da7974347 really did not work.

modules/demux/playlist/m3u.c

index 85194889aff864d63286d60d233550173ba0cfe1..b995895e00fb7c18fd3e78990150825c659c01f7 100644 (file)
@@ -70,8 +70,13 @@ int Import_M3U( vlc_object_t *p_this )
     CHECK_PEEK( p_peek, 8 );
     char *(*pf_dup) (const char *);
 
+    if( POKE( p_peek, "\xef\xbb\xbf", 3) )/* BOM at start */
+    {
+        pf_dup = CheckUnicode; /* UTF-8 */
+        stream_Seek( p_demux->s, 3 );
+    }
+    else
     if( POKE( p_peek, "RTSPtext", 8 ) /* QuickTime */
-     || POKE( p_peek, "\xef\xbb\xbf" "#EXTM3U", 10) /* BOM at start */
      || demux_IsPathExtension( p_demux, ".m3u8" )
      || demux_IsForced( p_demux, "m3u8" )
      || CheckContentType( p_demux->s, "application/vnd.apple.mpegurl" ) )