[vlc-devel] [PATCH] M3U: do not accept all UTF-8 playlist, unbreaks CUE support

Jean-Baptiste Kempf jb at videolan.org
Thu Aug 22 18:36:15 CEST 2013


5850dd13 was fixing something but broke UTF-8 .cue
---
 modules/demux/playlist/m3u.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index a942005..bb5656c 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -68,14 +68,14 @@ int Import_M3U( vlc_object_t *p_this )
     demux_t *p_demux = (demux_t *)p_this;
     const uint8_t *p_peek;
     CHECK_PEEK( p_peek, 8 );
-    char *(*pf_dup) (const char *);
+    char *(*pf_dup) (const char *) = NULL;
 
     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" )
@@ -88,7 +88,10 @@ int Import_M3U( vlc_object_t *p_this )
      || demux_IsForced( p_demux, "m3u" )
      || ContainsURL( p_demux )
      || CheckContentType( p_demux->s, "audio/x-mpegurl") )
-        pf_dup = GuessEncoding;
+    {
+        if(!pf_dup )
+            pf_dup = GuessEncoding;
+    }
     else
         return VLC_EGENERIC;
 
-- 
1.8.3.4




More information about the vlc-devel mailing list