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

Jean-Baptiste Kempf git at videolan.org
Thu Aug 22 18:55:04 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Aug 22 18:34:24 2013 +0200| [c892c9b2079c7c0e1f1256960d1707fb131e6f0b] | committer: Jean-Baptiste Kempf

M3U: do not accept all UTF-8 playlist, unbreaks CUE support

5850dd13 was fixing something but broke UTF-8 .cue

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

 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;
 



More information about the vlc-commits mailing list