From: RĂ©mi Denis-Courmont Date: Mon, 24 Jun 2013 15:52:10 +0000 (+0300) Subject: m3u8: correctly deal with BOM (fixes #8859) X-Git-Tag: 2.1.0-git~3 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5850dd1370c705b5cde2d6381b7feaedecec6b2e;p=vlc m3u8: correctly deal with BOM (fixes #8859) 75a167f5b377a1edba3e1bf0230af05da7974347 really did not work. --- diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c index 85194889af..b995895e00 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" ) )