]> git.nihav.org Git - nihav.git/commitdiff
smkdemux: ignore unknown audio streams with payload being present
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 25 Feb 2020 17:53:23 +0000 (18:53 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 25 Feb 2020 17:53:23 +0000 (18:53 +0100)
Some Smacker files have an additional stream with zero flags and 60Hz sampling rate.

nihav-rad/src/demuxers/smacker.rs

index 741756c12b3418f0c44fe6b0006a3b5987c70274..3fb1a6ee5963d67ad038a166c3bbb98b35b23ed5 100644 (file)
@@ -213,11 +213,14 @@ impl<'a> DemuxCore<'a> for SmackerVideoDemuxer<'a> {
         let ts = NATimeInfo::new(Some(self.cur_pts), None, None, 1, 100000);
         for i in 0..NUM_AUDIO_TRACKS {
             if ((frame_flags >> (i + 1)) & 1) == 0 { continue; }
-            validate!(self.ainfo[i].is_present());
             let size                            = self.src.read_u32le()? as usize;
             validate!(size > 4);
             validate!(payload_size >= size);
             payload_size -= size;
+            if !self.ainfo[i].is_present() {
+                self.src.read_skip(size - 4)?;
+                continue;
+            }
             let strres = strmgr.get_stream(self.ainfo[i].id);
             validate!(strres.is_some());
             let stream = strres.unwrap();