]> git.nihav.org Git - nihav.git/commitdiff
binkdmx: do not demux zero audio frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 30 Jan 2019 11:00:49 +0000 (12:00 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 30 Jan 2019 11:00:49 +0000 (12:00 +0100)
nihav-rad/src/demuxers/bink.rs

index e54ea8c7746bbbb81658dcdd3a238129c3afa6f2..4e0be7f0a55d9822b444fc323b25a35ddf578fa6 100644 (file)
@@ -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();