[vlc-commits] m3u8: correctly deal with BOM (fixes #8859)

Rémi Denis-Courmont git at videolan.org
Mon Jun 24 17:52:54 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jun 24 18:52:10 2013 +0300| [5850dd1370c705b5cde2d6381b7feaedecec6b2e] | committer: Rémi Denis-Courmont

m3u8: correctly deal with BOM (fixes #8859)

75a167f5b377a1edba3e1bf0230af05da7974347 really did not work.

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

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

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index 8519488..b995895 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -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" ) )



More information about the vlc-commits mailing list