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

Pierre Lamot git at videolan.org
Sun Dec 10 02:42:19 CET 2017


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

asx: fix mimetype and stream Peek

ASX is case insensitive

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 83397f87ff..41550b66f4 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->s, &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