Skip to content

Commit d232064

Browse files
authored
determine delay based on samples, not seconds (#229)
1 parent c0abdc3 commit d232064

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/software/resampling/context.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,7 @@ impl Context {
149149

150150
/// Get the remaining delay.
151151
pub fn delay(&self) -> Option<Delay> {
152-
unsafe {
153-
match swr_get_delay(self.as_ptr() as *mut _, 1) {
154-
0 => None,
155-
_ => Some(Delay::from(self)),
156-
}
157-
}
152+
unsafe { Some(Delay::from(self)).filter(|d| d.output > 0) }
158153
}
159154

160155
/// Run the resampler from the given input to the given output.

0 commit comments

Comments
 (0)