aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndreas Pehrson <[email protected]>2024-08-07 12:00:17 +0200
committerAndreas Pehrson <[email protected]>2024-08-07 12:00:17 +0200
commiteb8fb7e87d32abbb193a738d992b2cc40a9d90ae (patch)
tree9213ea17078bdf16c82e8ea78c11d22f070dbe5e
parentbbbe5bb0b29ed64cc7dd191d7a72fe24bba0d284 (diff)
downloadcubeb-resampler-rate-conversion-fix.tar.gz
cubeb-resampler-rate-conversion-fix.zip
In resampler's input_needed_for_output do not mix ratesresampler-rate-conversion-fix
-rw-r--r--src/cubeb_resampler_internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cubeb_resampler_internal.h b/src/cubeb_resampler_internal.h
index 285f24d..169732f 100644
--- a/src/cubeb_resampler_internal.h
+++ b/src/cubeb_resampler_internal.h
@@ -291,8 +291,8 @@ public:
int32_t resampled_frames_left =
samples_to_frames(resampling_out_buffer.length());
float input_frames_needed =
- (output_frame_count - unresampled_frames_left) * resampling_ratio -
- resampled_frames_left;
+ (output_frame_count - resampled_frames_left) * resampling_ratio -
+ unresampled_frames_left;
if (input_frames_needed < 0) {
return 0;
}