From: Kostya Shishkov Date: Fri, 19 Nov 2021 17:27:48 +0000 (+0100) Subject: ignore empty frames X-Git-Url: https://git.nihav.org/?p=nihav-player.git;a=commitdiff_plain;h=0a70659f1bac51dda65d0c8349a219c565b56c8c ignore empty frames --- 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) => {