From: Kostya Shishkov Date: Mon, 7 Apr 2025 16:42:08 +0000 (+0200) Subject: make audio converter output some samples if the output format does not care X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=a2aed6e3db3a69ea79c5d071314844f731542749;p=nihav-encoder.git make audio converter output some samples if the output format does not care Otherwise it would go into infinite loop outputting zero samples. --- 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,