mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
Volume adjustment must be done _after_ dropping the chunk since drop will
reject a modified chunk. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@472 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
c34f35a797
commit
bbc6dd68e2
1 changed files with 6 additions and 6 deletions
|
|
@ -222,12 +222,6 @@ int pa_sink_input_peek(pa_sink_input *i, pa_memchunk *chunk, pa_cvolume *volume)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
assert(tchunk.length);
|
assert(tchunk.length);
|
||||||
|
|
||||||
/* It might be necessary to adjust the volume here */
|
|
||||||
if (do_volume_adj_here) {
|
|
||||||
pa_memchunk_make_writable(&tchunk, i->sink->core->memblock_stat, 0);
|
|
||||||
pa_volume_memchunk(&tchunk, &i->sample_spec, &i->volume);
|
|
||||||
}
|
|
||||||
|
|
||||||
l = pa_resampler_request(i->resampler, CONVERT_BUFFER_LENGTH);
|
l = pa_resampler_request(i->resampler, CONVERT_BUFFER_LENGTH);
|
||||||
|
|
||||||
|
|
@ -237,6 +231,12 @@ int pa_sink_input_peek(pa_sink_input *i, pa_memchunk *chunk, pa_cvolume *volume)
|
||||||
i->drop(i, &tchunk, l);
|
i->drop(i, &tchunk, l);
|
||||||
tchunk.length = l;
|
tchunk.length = l;
|
||||||
|
|
||||||
|
/* It might be necessary to adjust the volume here */
|
||||||
|
if (do_volume_adj_here) {
|
||||||
|
pa_memchunk_make_writable(&tchunk, i->sink->core->memblock_stat, 0);
|
||||||
|
pa_volume_memchunk(&tchunk, &i->sample_spec, &i->volume);
|
||||||
|
}
|
||||||
|
|
||||||
pa_resampler_run(i->resampler, &tchunk, &i->resampled_chunk);
|
pa_resampler_run(i->resampler, &tchunk, &i->resampled_chunk);
|
||||||
pa_memblock_unref(tchunk.memblock);
|
pa_memblock_unref(tchunk.memblock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue