From: Kostya Shishkov Date: Wed, 30 Jan 2019 11:00:49 +0000 (+0100) Subject: binkdmx: do not demux zero audio frames X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=5faa5676138924a81d90f23377915d791695fd3b;p=nihav.git binkdmx: do not demux zero audio frames --- 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();