summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2021-11-19 18:27:48 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2021-11-19 18:27:48 +0100
commit0a70659f1bac51dda65d0c8349a219c565b56c8c (patch)
treefa87b5b2d500d90bdeb91b6ffef7e7f9c9340772
parentaa5a110c9fa3301102459c74ba1340b36d975693 (diff)
downloadnihav-player-0a70659f1bac51dda65d0c8349a219c565b56c8c.tar.gz
ignore empty frames
-rw-r--r--sndplay/src/main.rs3
1 files changed, 3 insertions, 0 deletions
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) => {