From: Kostya Shishkov Date: Tue, 25 Feb 2020 17:53:23 +0000 (+0100) Subject: smkdemux: ignore unknown audio streams with payload being present X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=dc19613ec7fe72fc0796422f3b0e4f688af12fe1;p=nihav.git smkdemux: ignore unknown audio streams with payload being present Some Smacker files have an additional stream with zero flags and 60Hz sampling rate. --- 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();