[vlc-devel] [PATCH] Do not detect all files with BOM as m3u playlists

Rafaël Carré funman at videolan.org
Thu Aug 22 18:36:09 CEST 2013


Close #9237
---
 modules/demux/playlist/m3u.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index a942005..fad765e 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -70,12 +70,6 @@ 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 */
      || demux_IsPathExtension( p_demux, ".m3u8" )
      || demux_IsForced( p_demux, "m3u8" )
@@ -92,6 +86,12 @@ int Import_M3U( vlc_object_t *p_this )
     else
         return VLC_EGENERIC;
 
+    if( POKE( p_peek, "\xef\xbb\xbf", 3) )/* BOM at start */
+    {
+        pf_dup = CheckUnicode; /* UTF-8 */
+        stream_Seek( p_demux->s, 3 );
+    }
+
     STANDARD_DEMUX_INIT_MSG( "found valid M3U playlist" );
     p_demux->p_sys->psz_prefix = FindPrefix( p_demux );
     p_demux->p_sys->pf_dup = pf_dup;
-- 
1.8.1.2



More information about the vlc-devel mailing list