Merge pull request #382 from storytold/fix/274-zero-rate-guard

Media: resampling footage audio guards a zero mix rate (#274)
This commit is contained in:
BFlat
2026-10-09 16:50:04 +07:00
committed by GitHub
+1 -1
View File
@@ -388,7 +388,7 @@ impl MediaPool {
let Some(src) = self.inner.source(&path) else { return vec![0.0; frames * 2] };
let s0 = start.to_units_floor(rate as i64);
let native = src.info().audio.as_ref().map_or(rate, |a| a.sample_rate);
if native == 0 || native == rate {
if native == 0 || rate == 0 || native == rate {
return read_stereo(&src, &path, s0, frames, rate);
}
// Output sample `n` sits at source position n × native / rate.