From 0a70659f1bac51dda65d0c8349a219c565b56c8c Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 19 Nov 2021 18:27:48 +0100 Subject: [PATCH] ignore empty frames --- sndplay/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sndplay/src/main.rs b/sndplay/src/main.rs index c8e75a4..275826f 100644 --- a/sndplay/src/main.rs +++ b/sndplay/src/main.rs @@ -153,6 +153,9 @@ impl<'a> Decoder<'a> { 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); } + if buf.get_audio_length() == 0 { + return false; + } let out_buf = convert_audio_frame(&buf, &self.dst_info, &self.dst_chmap).unwrap(); match out_buf { NABufferType::AudioI16(abuf) => { -- 2.39.5