From 5faa5676138924a81d90f23377915d791695fd3b Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 30 Jan 2019 12:00:49 +0100 Subject: [PATCH] binkdmx: do not demux zero audio frames --- nihav-rad/src/demuxers/bink.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nihav-rad/src/demuxers/bink.rs b/nihav-rad/src/demuxers/bink.rs index e54ea8c..4e0be7f 100644 --- a/nihav-rad/src/demuxers/bink.rs +++ b/nihav-rad/src/demuxers/bink.rs @@ -117,12 +117,14 @@ impl<'a> DemuxCore<'a> for BinkDemuxer<'a> { validate!(payload_size > size + 4); payload_size -= size + 4; - let strres = strmgr.get_stream(atrk.id); - validate!(strres.is_some()); - let stream = strres.unwrap(); - let ts = NATimeInfo::new(Some(self.cur_frame as u64), None, None, self.tb_num, self.tb_den); - let pkt = self.src.read_packet(stream.clone(), ts, true, size)?; - self.queued_packets.push(pkt); + if size > 0 { + let strres = strmgr.get_stream(atrk.id); + validate!(strres.is_some()); + let stream = strres.unwrap(); + let ts = NATimeInfo::new(Some(self.cur_frame as u64), None, None, self.tb_num, self.tb_den); + let pkt = self.src.read_packet(stream.clone(), ts, true, size)?; + self.queued_packets.push(pkt); + } } self.queued_packets.reverse(); -- 2.39.5