mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
echo-cancel: Fix apply_diff_time() to use correct sample spec
apply_diff_time() fails when dropping bytes from the playback stream and the sample spec of sink and source differ as source's sample spec is used. Fix this by using sink's sample spec. Signed-off-by: Stefan Huber <s.huber@bct-electronic.com> Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
parent
4d65c9582d
commit
53f2964b40
1 changed files with 2 additions and 2 deletions
|
|
@ -660,12 +660,12 @@ static void apply_diff_time(struct userdata *u, int64_t diff_time) {
|
|||
int64_t diff;
|
||||
|
||||
if (diff_time < 0) {
|
||||
diff = pa_usec_to_bytes(-diff_time, &u->source_output->sample_spec);
|
||||
diff = pa_usec_to_bytes(-diff_time, &u->sink_input->sample_spec);
|
||||
|
||||
if (diff > 0) {
|
||||
/* add some extra safety samples to compensate for jitter in the
|
||||
* timings */
|
||||
diff += 10 * pa_frame_size (&u->source_output->sample_spec);
|
||||
diff += 10 * pa_frame_size (&u->sink_input->sample_spec);
|
||||
|
||||
pa_log("Playback after capture (%lld), drop sink %lld", (long long) diff_time, (long long) diff);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue