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:
parent
cae67546dd
commit
fc5771f00f
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue