mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-23 06:59:53 -05:00
drop chunk argument from various drop() functions, since it doesn't make any sense if we want to guarantee always monotonously increasing read pointers; a couple of other fixes
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1529 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
9cc20b46b7
commit
068f5d5eef
14 changed files with 341 additions and 217 deletions
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include "play-memblockq.h"
|
||||
|
||||
static void sink_input_kill(pa_sink_input *i) {
|
||||
static void sink_input_kill_cb(pa_sink_input *i) {
|
||||
pa_memblockq *q;
|
||||
assert(i);
|
||||
assert(i->userdata);
|
||||
|
|
@ -50,7 +50,7 @@ static void sink_input_kill(pa_sink_input *i) {
|
|||
pa_memblockq_free(q);
|
||||
}
|
||||
|
||||
static int sink_input_peek(pa_sink_input *i, pa_memchunk *chunk) {
|
||||
static int sink_input_peek_cb(pa_sink_input *i, pa_memchunk *chunk) {
|
||||
pa_memblockq *q;
|
||||
assert(i);
|
||||
assert(chunk);
|
||||
|
|
@ -61,11 +61,11 @@ static int sink_input_peek(pa_sink_input *i, pa_memchunk *chunk) {
|
|||
return pa_memblockq_peek(q, chunk);
|
||||
}
|
||||
|
||||
static void si_kill(PA_GCC_UNUSED pa_mainloop_api *m, void *i) {
|
||||
sink_input_kill(i);
|
||||
static void si_kill_cb(PA_GCC_UNUSED pa_mainloop_api *m, void *i) {
|
||||
sink_input_kill_cb(i);
|
||||
}
|
||||
|
||||
static void sink_input_drop(pa_sink_input *i, const pa_memchunk*chunk, size_t length) {
|
||||
static void sink_input_drop_cb(pa_sink_input *i, size_t length) {
|
||||
pa_memblockq *q;
|
||||
|
||||
assert(i);
|
||||
|
|
@ -74,10 +74,10 @@ static void sink_input_drop(pa_sink_input *i, const pa_memchunk*chunk, size_t le
|
|||
|
||||
q = i->userdata;
|
||||
|
||||
pa_memblockq_drop(q, chunk, length);
|
||||
pa_memblockq_drop(q, length);
|
||||
|
||||
if (pa_memblockq_get_length(q) <= 0)
|
||||
pa_mainloop_api_once(i->sink->core->mainloop, si_kill, i);
|
||||
pa_mainloop_api_once(i->sink->core->mainloop, si_kill_cb, i);
|
||||
}
|
||||
|
||||
int pa_play_memblockq(
|
||||
|
|
@ -116,9 +116,9 @@ int pa_play_memblockq(
|
|||
if (!(si = pa_sink_input_new(sink->core, &data, 0)))
|
||||
return -1;
|
||||
|
||||
si->peek = sink_input_peek;
|
||||
si->drop = sink_input_drop;
|
||||
si->kill = sink_input_kill;
|
||||
si->peek = sink_input_peek_cb;
|
||||
si->drop = sink_input_drop_cb;
|
||||
si->kill = sink_input_kill_cb;
|
||||
|
||||
si->userdata = q;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue