[vlc-commits] [Git][videolan/vlc][master] 2 commits: demux: adaptive: skip ID3 in front of any segment

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Oct 31 09:26:53 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e062e9d6 by Francois Cartegnie at 2022-10-31T09:02:33+00:00
demux: adaptive: skip ID3 in front of any segment

more HLS crap FTW

refs #27441

- - - - -
7b2c8480 by Francois Cartegnie at 2022-10-31T09:02:33+00:00
demux: adaptive: fix MIME format update

refs #27441

- - - - -


2 changed files:

- modules/demux/adaptive/SegmentTracker.cpp
- modules/demux/adaptive/StreamFormat.cpp


Changes:

=====================================
modules/demux/adaptive/SegmentTracker.cpp
=====================================
@@ -399,7 +399,7 @@ ChunkInterface * SegmentTracker::getNextChunk(bool switch_allowed)
         chunkformat = StreamFormat(p_peek, i_peek);
         /* fallback on Mime type */
         if(chunkformat == StreamFormat(StreamFormat::Type::Unknown))
-            format = StreamFormat(chunk.chunk->getContentType());
+            chunkformat = StreamFormat(chunk.chunk->getContentType());
         chunk.chunk->setStreamFormat(chunkformat);
         returnedChunk = wrappedck;
     }


=====================================
modules/demux/adaptive/StreamFormat.cpp
=====================================
@@ -128,6 +128,16 @@ StreamFormat::StreamFormat(const void *data_, size_t sz)
     type = Type::Unknown;
     const char moov[] = "ftypmoovmoofemsg";
 
+    /* Skipped ID3 if any */
+    while(sz > 10 && ID3TAG_IsTag(data, false))
+    {
+        size_t tagsize = ID3TAG_Parse(data, sz, ID3Callback, this);
+        if(tagsize >= sz || tagsize == 0)
+            return; /* not enough peek */
+        data += tagsize;
+        sz -= tagsize;
+    }
+
     if(sz > 188 && data[0] == 0x47 && data[188] == 0x47)
         type = StreamFormat::Type::MPEG2TS;
     else if(sz > 8 && (!memcmp(&moov,    &data[4], 4) ||
@@ -144,15 +154,6 @@ StreamFormat::StreamFormat(const void *data_, size_t sz)
     else /* Check Packet Audio formats */
     {
         /* It MUST have ID3 header, but HLS spec is an oxymoron */
-        while(sz > 10 && ID3TAG_IsTag(data, false))
-        {
-            size_t tagsize = ID3TAG_Parse(data, sz, ID3Callback, this);
-            if(tagsize >= sz || tagsize == 0)
-                return; /* not enough peek */
-            data += tagsize;
-            sz -= tagsize;
-        }
-        /* Skipped ID3 if any */
         if(sz > 3 && (!memcmp("\xFF\xF1", data, 2) ||
                       !memcmp("\xFF\xF9", data, 2)))
         {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c4d3bdd4c3a03613f796baef188134317024ba2b...7b2c84807e92b8b2282f3b25b0cd8759cbf8c472

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c4d3bdd4c3a03613f796baef188134317024ba2b...7b2c84807e92b8b2282f3b25b0cd8759cbf8c472
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list