mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
source-output: do volume_factor_source application before resampling
Applying the volume after resampling means mismatch between the volume channel map and the data channel map. volume_factor_source is not currently used anywhere, so this bug hasn't been causing any problems. I noticed it while reading the code.
This commit is contained in:
parent
a958297fc8
commit
b2e7cf6521
1 changed files with 7 additions and 13 deletions
|
|
@ -792,14 +792,14 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
|
||||||
pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->thread_info.soft_volume);
|
pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->thread_info.soft_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!o->thread_info.resampler) {
|
if (nvfs) {
|
||||||
if (nvfs) {
|
pa_memchunk_make_writable(&qchunk, 0);
|
||||||
pa_memchunk_make_writable(&qchunk, 0);
|
pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->volume_factor_source);
|
||||||
pa_volume_memchunk(&qchunk, &o->thread_info.sample_spec, &o->volume_factor_source);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!o->thread_info.resampler)
|
||||||
o->push(o, &qchunk);
|
o->push(o, &qchunk);
|
||||||
} else {
|
else {
|
||||||
pa_memchunk rchunk;
|
pa_memchunk rchunk;
|
||||||
|
|
||||||
if (mbs == 0)
|
if (mbs == 0)
|
||||||
|
|
@ -810,14 +810,8 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
|
||||||
|
|
||||||
pa_resampler_run(o->thread_info.resampler, &qchunk, &rchunk);
|
pa_resampler_run(o->thread_info.resampler, &qchunk, &rchunk);
|
||||||
|
|
||||||
if (rchunk.length > 0) {
|
if (rchunk.length > 0)
|
||||||
if (nvfs) {
|
|
||||||
pa_memchunk_make_writable(&rchunk, 0);
|
|
||||||
pa_volume_memchunk(&rchunk, &o->thread_info.sample_spec, &o->volume_factor_source);
|
|
||||||
}
|
|
||||||
|
|
||||||
o->push(o, &rchunk);
|
o->push(o, &rchunk);
|
||||||
}
|
|
||||||
|
|
||||||
if (rchunk.memblock)
|
if (rchunk.memblock)
|
||||||
pa_memblock_unref(rchunk.memblock);
|
pa_memblock_unref(rchunk.memblock);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue