Fix distorted sound with PulseAudio and uneven channels
This commit is contained in:
parent
9eb4b6d91a
commit
dbf7cad04f
|
@ -346,9 +346,9 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
|
|||
for (int j = 0; j < ad->pa_map.channels - 1; j++) {
|
||||
ad->samples_out.write[out_idx++] = ad->samples_in[in_idx++] >> 16;
|
||||
}
|
||||
uint32_t l = ad->samples_in[in_idx++];
|
||||
uint32_t r = ad->samples_in[in_idx++];
|
||||
ad->samples_out.write[out_idx++] = ((l >> 1) + (r >> 1)) >> 16;
|
||||
uint32_t l = ad->samples_in[in_idx++] >> 16;
|
||||
uint32_t r = ad->samples_in[in_idx++] >> 16;
|
||||
ad->samples_out.write[out_idx++] = (l + r) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue