[vlc-commits] demux: hls: fix mp4 probing

Francois Cartegnie git at videolan.org
Wed Jun 19 17:38:11 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 18 14:17:18 2019 +0200| [574a2d34bdc4360c033af03077afe11a52f06dcc] | committer: Francois Cartegnie

demux: hls: fix mp4 probing

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

 modules/demux/adaptive/StreamFormat.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptive/StreamFormat.cpp b/modules/demux/adaptive/StreamFormat.cpp
index 7d0d4a448e..7d03203417 100644
--- a/modules/demux/adaptive/StreamFormat.cpp
+++ b/modules/demux/adaptive/StreamFormat.cpp
@@ -90,11 +90,12 @@ StreamFormat::StreamFormat(const void *data_, size_t sz)
     const uint8_t *data = reinterpret_cast<const uint8_t *>(data_);
     formatid = UNKNOWN;
     const char moov[] = "ftypmoovmoof";
+
     if(sz > 188 && data[0] == 0x47 && data[188] == 0x47)
         formatid = StreamFormat::MPEG2TS;
-    else if(sz > 4 && (!memcmp(&moov, data, 4) ||
-                       !memcmp(&moov[4], data, 4) ||
-                       !memcmp(&moov[8], data, 4)))
+    else if(sz > 8 && (!memcmp(&moov,    &data[4], 4) ||
+                       !memcmp(&moov[4], &data[4], 4) ||
+                       !memcmp(&moov[8], &data[4], 4)))
         formatid = StreamFormat::MP4;
     else if(sz > 7 && !memcmp("WEBVTT", data, 6) &&
             std::isspace(static_cast<unsigned char>(data[7])))



More information about the vlc-commits mailing list