mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
add a "length" argument to the seek functions, as an optimization to request a certain block size if any data needs to be generated. this is merely a hint.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1833 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
5df7a85473
commit
1d1eda6059
11 changed files with 94 additions and 50 deletions
|
|
@ -275,7 +275,7 @@ finish:
|
|||
pa_log_debug("Thread shutting down");
|
||||
}
|
||||
|
||||
static void request_memblock(struct output *o) {
|
||||
static void request_memblock(struct output *o, size_t length) {
|
||||
pa_memchunk chunk;
|
||||
|
||||
pa_assert(o);
|
||||
|
|
@ -306,7 +306,7 @@ static void request_memblock(struct output *o) {
|
|||
struct output *j;
|
||||
|
||||
/* Do it! */
|
||||
pa_sink_render(o->userdata->sink, o->userdata->block_size, &chunk);
|
||||
pa_sink_render(o->userdata->sink, length, &chunk);
|
||||
|
||||
/* OK, let's send this data to the other threads */
|
||||
for (j = o->userdata->thread_info.outputs; j; j = j->next)
|
||||
|
|
@ -323,7 +323,7 @@ static void request_memblock(struct output *o) {
|
|||
}
|
||||
|
||||
/* Called from I/O thread context */
|
||||
static int sink_input_peek_cb(pa_sink_input *i, pa_memchunk *chunk) {
|
||||
static int sink_input_peek_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk) {
|
||||
struct output *o;
|
||||
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
|
@ -331,7 +331,7 @@ static int sink_input_peek_cb(pa_sink_input *i, pa_memchunk *chunk) {
|
|||
pa_assert(o);
|
||||
|
||||
/* If necessary, get some new data */
|
||||
request_memblock(o);
|
||||
request_memblock(o, length);
|
||||
|
||||
return pa_memblockq_peek(o->memblockq, chunk);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ static const char* const valid_modargs[] = {
|
|||
NULL,
|
||||
};
|
||||
|
||||
static int sink_input_peek_cb(pa_sink_input *i, pa_memchunk *chunk) {
|
||||
static int sink_input_peek_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk) {
|
||||
struct userdata *u;
|
||||
|
||||
pa_assert(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue