mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
Revert r1404 and keep it on a development branch until it is fully tested.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1409 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
6ca819354c
commit
8dc6214276
36 changed files with 499 additions and 990 deletions
|
|
@ -63,7 +63,7 @@ static int sink_input_peek(pa_sink_input *i, pa_memchunk *chunk) {
|
|||
|
||||
chunk->memblock = pa_memblock_ref(u->memblock);
|
||||
chunk->index = u->peek_index;
|
||||
chunk->length = pa_memblock_get_length(u->memblock) - u->peek_index;
|
||||
chunk->length = u->memblock->length - u->peek_index;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -72,12 +72,11 @@ static void sink_input_drop(pa_sink_input *i, const pa_memchunk *chunk, size_t l
|
|||
assert(i && chunk && length && i->userdata);
|
||||
u = i->userdata;
|
||||
|
||||
assert(chunk->memblock == u->memblock);
|
||||
assert(length <= pa_memblock_get_length(u->memblock)-u->peek_index);
|
||||
assert(chunk->memblock == u->memblock && length <= u->memblock->length-u->peek_index);
|
||||
|
||||
u->peek_index += length;
|
||||
|
||||
if (u->peek_index >= pa_memblock_get_length(u->memblock))
|
||||
if (u->peek_index >= u->memblock->length)
|
||||
u->peek_index = 0;
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +109,6 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
pa_sample_spec ss;
|
||||
uint32_t frequency;
|
||||
char t[256];
|
||||
void *p;
|
||||
pa_sink_input_new_data data;
|
||||
|
||||
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
|
||||
|
|
@ -142,10 +140,8 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
}
|
||||
|
||||
u->memblock = pa_memblock_new(c->mempool, pa_bytes_per_second(&ss));
|
||||
p = pa_memblock_acquire(u->memblock);
|
||||
calc_sine(p, pa_memblock_get_length(u->memblock), frequency);
|
||||
pa_memblock_release(u->memblock);
|
||||
|
||||
calc_sine(u->memblock->data, u->memblock->length, frequency);
|
||||
|
||||
snprintf(t, sizeof(t), "Sine Generator at %u Hz", frequency);
|
||||
|
||||
pa_sink_input_new_data_init(&data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue