diff options
author | Arun Raghavan <arun@arunraghavan.net> | 2017-12-27 11:17:01 +0530 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2017-12-27 11:17:01 +0530 |
commit | 1e787687df33b181e64960a0aec3e8ec609d4492 (patch) | |
tree | 4c5550fd512091d3d7545f7e6e7f0e09c47b22b0 | |
parent | 972942e253210ab112f6252f25f50c3fe0cd718b (diff) |
mix: Replace manual frame/time calculations with correct functions
-rw-r--r-- | src/pulsecore/mix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c index d89906bd2..2e7d05a29 100644 --- a/src/pulsecore/mix.c +++ b/src/pulsecore/mix.c @@ -866,8 +866,8 @@ void pa_volume_ramp_memchunk( pa_assert(pa_frame_aligned(c->length, spec)); pa_assert(ramp); - length_in_frames = c->length / pa_sample_size_of_format(spec->format) / spec->channels; - time_of_frames = length_in_frames * 1000000 / spec->rate; + length_in_frames = c->length / pa_frame_size(spec); + time_of_frames = pa_bytes_to_usec(c->length, spec); if (pa_memblock_is_silence(c->memblock)) { for (i = 0; i < ramp->channels; i++) { |