From 89f532457d906fb7b5d2798ab341872a88aafaf7 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 5 Apr 2021 18:38:48 +0200 Subject: [PATCH] sndplay: skip null audio buffers --- sndplay/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sndplay/src/main.rs b/sndplay/src/main.rs index a5fc6ff..39ee76d 100644 --- a/sndplay/src/main.rs +++ b/sndplay/src/main.rs @@ -147,6 +147,9 @@ impl<'a> Decoder<'a> { match self.decoder.decode(&mut self.dsupp, &pkt) { Ok(frm) => { let buf = frm.get_buffer(); + if let NABufferType::None = buf { + return false; + } if let Some(pts) = frm.ts.get_pts() { self.samplepos = NATimeInfo::ts_to_time(pts, u64::from(self.arate), frm.ts.tb_num, frm.ts.tb_den); } -- 2.39.5