mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
fix bug where we silently dropped data that didn't fit into one mempool tile
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2220 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
98b0152d7c
commit
c84a64cf32
1 changed files with 27 additions and 18 deletions
|
|
@ -517,24 +517,29 @@ int pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, pa
|
|||
pa_assert(tchunk.length > 0);
|
||||
pa_assert(tchunk.memblock);
|
||||
|
||||
if (tchunk.length > block_size_max_sink_input)
|
||||
tchunk.length = block_size_max_sink_input;
|
||||
while (tchunk.length > 0) {
|
||||
pa_memchunk wchunk;
|
||||
|
||||
wchunk = tchunk;
|
||||
|
||||
if (wchunk.length > block_size_max_sink_input)
|
||||
wchunk.length = block_size_max_sink_input;
|
||||
|
||||
/* It might be necessary to adjust the volume here */
|
||||
if (do_volume_adj_here && !volume_is_norm) {
|
||||
pa_memchunk_make_writable(&tchunk, 0);
|
||||
pa_memchunk_make_writable(&wchunk, 0);
|
||||
|
||||
if (i->thread_info.muted)
|
||||
pa_silence_memchunk(&tchunk, &i->thread_info.sample_spec);
|
||||
pa_silence_memchunk(&wchunk, &i->thread_info.sample_spec);
|
||||
else
|
||||
pa_volume_memchunk(&tchunk, &i->thread_info.sample_spec, &i->thread_info.volume);
|
||||
pa_volume_memchunk(&wchunk, &i->thread_info.sample_spec, &i->thread_info.volume);
|
||||
}
|
||||
|
||||
if (!i->thread_info.resampler)
|
||||
pa_memblockq_push_align(i->thread_info.render_memblockq, &tchunk);
|
||||
pa_memblockq_push_align(i->thread_info.render_memblockq, &wchunk);
|
||||
else {
|
||||
pa_memchunk rchunk;
|
||||
pa_resampler_run(i->thread_info.resampler, &tchunk, &rchunk);
|
||||
pa_resampler_run(i->thread_info.resampler, &wchunk, &rchunk);
|
||||
|
||||
if (rchunk.memblock) {
|
||||
pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk);
|
||||
|
|
@ -542,6 +547,10 @@ int pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, pa
|
|||
}
|
||||
}
|
||||
|
||||
tchunk.index += wchunk.length;
|
||||
tchunk.length -= wchunk.length;
|
||||
}
|
||||
|
||||
pa_memblock_unref(tchunk.memblock);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue