Media: resampling footage audio guards a zero mix rate (#274)

A requested rate of 0 would divide by zero in the resampler; it now
reads through the plain path, which returns silence for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic 2026-10-09 16:43:21 +07:00
parent cae67546dd
commit fc5771f00f
1 changed files with 1 additions and 1 deletions

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.