From a2aed6e3db3a69ea79c5d071314844f731542749 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 7 Apr 2025 18:42:08 +0200 Subject: [PATCH] make audio converter output some samples if the output format does not care Otherwise it would go into infinite loop outputting zero samples. --- src/acvt.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/acvt.rs b/src/acvt.rs index 254bed6..903c8cf 100644 --- a/src/acvt.rs +++ b/src/acvt.rs @@ -176,9 +176,13 @@ impl AudioConverter { }; const RESAMPLE_FILTER_ORDER: usize = 16; let resampler = NAResample::new(sinfo.sample_rate, dinfo, &dst_chmap, RESAMPLE_FILTER_ORDER); + let mut dst_fmt = *dinfo; + if dst_fmt.block_len == 0 { + dst_fmt.block_len = 256; + } Self { queue, - dst_fmt: *dinfo, + dst_fmt, dst_chmap, apts: None, resampler, -- 2.39.5