[vlc-commits] asx: fix mimetype and stream Peek

Pierre Lamot git at videolan.org
Sun Dec 10 23:33:58 CET 2017


vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Dec  6 16:06:52 2017 +0100| [927ca1c5c4d93c9831b7edb3e3f2365a793bd9f7] | committer: Jean-Baptiste Kempf

asx: fix mimetype and stream Peek

ASX is case insensitive

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 866888790951157d9321d3f215e40611a2d600f4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/playlist/asx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 9ea34fe929..eb2de55c38 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -40,6 +40,7 @@
 
 #include <assert.h>
 #include <ctype.h>
+#include <string.h>
 
 #include "playlist.h"
 
@@ -136,7 +137,7 @@ static bool PeekASX( stream_t *s )
 {
     const uint8_t *p_peek;
     return ( vlc_stream_Peek( s->p_source, &p_peek, 12 ) == 12
-             && !memcmp( p_peek, "<asx version", 12 ) );
+             && !strncasecmp( (const char*) p_peek, "<asx version", 12 ) );
 }
 
 /*****************************************************************************
@@ -154,7 +155,7 @@ int Import_ASX( vlc_object_t *p_this )
     if( stream_HasExtension( p_demux, ".asx" )
      || stream_HasExtension( p_demux, ".wax" )
      || stream_HasExtension( p_demux, ".wvx" )
-     || (type != NULL && (strcasecmp(type, "video-x-ms-asf") == 0
+     || (type != NULL && (strcasecmp(type, "video/x-ms-asf") == 0
                        || strcasecmp(type, "audio/x-ms-wax") == 0)
                       && PeekASX( p_demux ) ) )
     {



More information about the vlc-commits mailing list