diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-09-26 17:02:26 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-09-26 17:02:26 +0000 |
commit | 5bac3c3ce515cb588f3928431db4fe1c396d53e7 (patch) | |
tree | 7ec714219121bee11db5f7f497879e805ea30926 /polyp/sink-input.c | |
parent | 405fac5ea7070fa7b50a77952fa8042f87f588a8 (diff) |
bum version number
add new macro PA_API_VERSION for preprocessor level conditional compiling
add new native APIs:
- counter
- cork & flush for record streams
- add flags parameters to pa_stream_connect_xx()
- new prebuf command
- time api, and total latency calculator
- return sample spec
ability to cork source output streams
dump server status on SIGHUP to syslog
show sink input/source outputs status in cli-text.c
don't flush esound output buffer when client disconnects
move version api to polyplib-version.h
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@240 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/sink-input.c')
-rw-r--r-- | polyp/sink-input.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/polyp/sink-input.c b/polyp/sink-input.c index 94930231..5c8675de 100644 --- a/polyp/sink-input.c +++ b/polyp/sink-input.c @@ -70,7 +70,6 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con i->get_latency = NULL; i->userdata = NULL; - i->corked = 0; i->volume = PA_VOLUME_NORM; i->resampled_chunk.memblock = NULL; @@ -92,7 +91,7 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con } void pa_sink_input_disconnect(struct pa_sink_input *i) { - assert(i && i->state == PA_SINK_INPUT_RUNNING && i->sink && i->sink->core); + assert(i && i->state != PA_SINK_INPUT_DISCONNECTED && i->sink && i->sink->core); pa_idxset_remove_by_data(i->sink->core->sink_inputs, i, NULL); pa_idxset_remove_by_data(i->sink->inputs, i, NULL); @@ -163,7 +162,7 @@ int pa_sink_input_peek(struct pa_sink_input *i, struct pa_memchunk *chunk) { if (!i->peek || !i->drop) return -1; - if (i->corked) + if (i->state == PA_SINK_INPUT_CORKED) return -1; if (!i->resampler) @@ -238,9 +237,12 @@ void pa_sink_input_set_volume(struct pa_sink_input *i, pa_volume_t volume) { void pa_sink_input_cork(struct pa_sink_input *i, int b) { int n; assert(i && i->ref >= 1); - - n = i->corked && !b; - i->corked = b; + + if (i->state == PA_SINK_INPUT_DISCONNECTED) + return; + + n = i->state == PA_SINK_INPUT_CORKED && !b; + i->state = b ? PA_SINK_INPUT_CORKED : PA_SINK_INPUT_RUNNING; if (n) pa_sink_notify(i->sink); |