mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
Move the encoding loop around a bit such that it does not grab the data and keep it for the next loop iteration.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2481 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
3767cdb6d1
commit
6c1dd6e54b
1 changed files with 12 additions and 10 deletions
|
|
@ -216,17 +216,19 @@ static void thread_func(void *userdata) {
|
|||
ssize_t l;
|
||||
void *p;
|
||||
|
||||
if (u->raw_memchunk.length <= 0) {
|
||||
if (u->raw_memchunk.memblock)
|
||||
pa_memblock_unref(u->raw_memchunk.memblock);
|
||||
pa_memchunk_reset(&u->raw_memchunk);
|
||||
|
||||
/* Grab unencoded data */
|
||||
pa_sink_render(u->sink, u->block_size, &u->raw_memchunk);
|
||||
}
|
||||
pa_assert(u->raw_memchunk.length > 0);
|
||||
|
||||
if (u->encoded_memchunk.length <= 0) {
|
||||
if (u->raw_memchunk.length <= 0) {
|
||||
if (u->raw_memchunk.memblock)
|
||||
pa_memblock_unref(u->raw_memchunk.memblock);
|
||||
pa_memchunk_reset(&u->raw_memchunk);
|
||||
|
||||
/* Grab unencoded data */
|
||||
pa_sink_render(u->sink, u->block_size, &u->raw_memchunk);
|
||||
p = pa_memblock_acquire(u->raw_memchunk.memblock);
|
||||
pa_memblock_release(u->raw_memchunk.memblock);
|
||||
}
|
||||
pa_assert(u->raw_memchunk.length > 0);
|
||||
|
||||
/* Encode it */
|
||||
size_t rl = u->raw_memchunk.length;
|
||||
u->encoding_overhead += u->next_encoding_overhead;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue