diff --git a/src/software/resampling/context.rs b/src/software/resampling/context.rs index 330733b0..1d30cf45 100644 --- a/src/software/resampling/context.rs +++ b/src/software/resampling/context.rs @@ -149,12 +149,7 @@ impl Context { /// Get the remaining delay. pub fn delay(&self) -> Option { - unsafe { - match swr_get_delay(self.as_ptr() as *mut _, 1) { - 0 => None, - _ => Some(Delay::from(self)), - } - } + unsafe { Some(Delay::from(self)).filter(|d| d.output > 0) } } /// Run the resampler from the given input to the given output.