From dc19613ec7fe72fc0796422f3b0e4f688af12fe1 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 25 Feb 2020 18:53:23 +0100 Subject: [PATCH] smkdemux: ignore unknown audio streams with payload being present Some Smacker files have an additional stream with zero flags and 60Hz sampling rate. --- nihav-rad/src/demuxers/smacker.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nihav-rad/src/demuxers/smacker.rs b/nihav-rad/src/demuxers/smacker.rs index 741756c..3fb1a6e 100644 --- a/nihav-rad/src/demuxers/smacker.rs +++ b/nihav-rad/src/demuxers/smacker.rs @@ -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(); -- 2.39.5