summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-04-22 01:04:27 +0000
committerLennart Poettering <lennart@poettering.net>2008-04-22 01:04:27 +0000
commite16a1987a3ffa33b4a04a4c3a02320d79fd14195 (patch)
tree431b3cd6251baeaf9f620d4e2b68c03e7b9857e9 /src/pulsecore
parent88227c41c1dc9505b043b6a37ca86eaafe5b549f (diff)
- Change meaning of special values of latency request: 0 -> "minimal latency, please"; (pa_usec_t)-1 -> "don't care"
- Remove "source" word from monitor source description - Increase default tsched watermark to 20ms again - For the first iteration after snd_pcm_start() halve the sleep time as workaround for USB devices with quick starts git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2291 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/sink-input.c6
-rw-r--r--src/pulsecore/sink.c12
-rw-r--r--src/pulsecore/source-output.c4
-rw-r--r--src/pulsecore/source.c10
4 files changed, 15 insertions, 17 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index ccb1ff11..8df36876 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -247,7 +247,7 @@ pa_sink_input* pa_sink_input_new(
i->thread_info.resampler = resampler;
i->thread_info.volume = i->volume;
i->thread_info.muted = i->muted;
- i->thread_info.requested_sink_latency = 0;
+ i->thread_info.requested_sink_latency = (pa_usec_t) -1;
i->thread_info.rewrite_nbytes = 0;
i->thread_info.since_underrun = 0;
i->thread_info.ignore_rewind = FALSE;
@@ -534,8 +534,6 @@ int pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, pa
if (do_volume_adj_here && !volume_is_norm) {
pa_memchunk_make_writable(&wchunk, 0);
- pa_log_debug("adjusting volume!");
-
if (i->thread_info.muted)
pa_silence_memchunk(&wchunk, &i->thread_info.sample_spec);
else
@@ -682,7 +680,7 @@ void pa_sink_input_update_max_rewind(pa_sink_input *i, size_t nbytes /* in the
pa_usec_t pa_sink_input_set_requested_latency(pa_sink_input *i, pa_usec_t usec) {
pa_sink_input_assert_ref(i);
- if (usec > 0) {
+ if (usec != (pa_usec_t) -1) {
if (i->sink->max_latency > 0 && usec > i->sink->max_latency)
usec = i->sink->max_latency;
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 34fb7ae9..e88e7d2b 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -217,7 +217,7 @@ pa_sink* pa_sink_new(
s->thread_info.state = s->state;
s->thread_info.rewind_nbytes = 0;
s->thread_info.max_rewind = 0;
- s->thread_info.requested_latency_valid = TRUE;
+ s->thread_info.requested_latency_valid = FALSE;
s->thread_info.requested_latency = 0;
pa_assert_se(pa_idxset_put(core->sinks, s, &s->index) >= 0);
@@ -236,7 +236,7 @@ pa_sink* pa_sink_new(
source_data.module = data->module;
dn = pa_proplist_gets(s->proplist, PA_PROP_DEVICE_DESCRIPTION);
- pa_proplist_setf(source_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Monitor Source of %s", dn ? dn : s->name);
+ pa_proplist_setf(source_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Monitor of %s", dn ? dn : s->name);
pa_proplist_sets(source_data.proplist, PA_PROP_DEVICE_CLASS, "monitor");
s->monitor_source = pa_source_new(core, &source_data, 0);
@@ -1257,7 +1257,7 @@ void pa_sink_request_rewind(pa_sink*s, size_t nbytes) {
}
pa_usec_t pa_sink_get_requested_latency_within_thread(pa_sink *s) {
- pa_usec_t result = 0;
+ pa_usec_t result = (pa_usec_t) -1;
pa_sink_input *i;
void *state = NULL;
@@ -1268,11 +1268,11 @@ pa_usec_t pa_sink_get_requested_latency_within_thread(pa_sink *s) {
while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL)))
- if (i->thread_info.requested_sink_latency > 0 &&
- (!result || result > i->thread_info.requested_sink_latency))
+ if (i->thread_info.requested_sink_latency != (pa_usec_t) -1 &&
+ (result == (pa_usec_t) -1 || result > i->thread_info.requested_sink_latency))
result = i->thread_info.requested_sink_latency;
- if (result > 0) {
+ if (result != (pa_usec_t) -1) {
if (s->max_latency > 0 && result > s->max_latency)
result = s->max_latency;
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index c6dc9e88..9c75b39c 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -198,7 +198,7 @@ pa_source_output* pa_source_output_new(
o->thread_info.attached = FALSE;
o->thread_info.sample_spec = o->sample_spec;
o->thread_info.resampler = resampler;
- o->thread_info.requested_source_latency = 0;
+ o->thread_info.requested_source_latency = (pa_usec_t) -1;
o->thread_info.delay_memblockq = pa_memblockq_new(
0,
@@ -449,7 +449,7 @@ void pa_source_output_update_max_rewind(pa_source_output *o, size_t nbytes /* i
pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t usec) {
pa_source_output_assert_ref(o);
- if (usec > 0) {
+ if (usec != (pa_usec_t) -1) {
if (o->source->max_latency > 0 && usec > o->source->max_latency)
usec = o->source->max_latency;
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 8138a43f..27279719 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -204,7 +204,7 @@ pa_source* pa_source_new(
s->thread_info.soft_muted = s->muted;
s->thread_info.state = s->state;
s->thread_info.max_rewind = 0;
- s->thread_info.requested_latency_valid = TRUE;
+ s->thread_info.requested_latency_valid = FALSE;
s->thread_info.requested_latency = 0;
pa_assert_se(pa_idxset_put(core->sources, s, &s->index) >= 0);
@@ -713,7 +713,7 @@ void pa_source_attach_within_thread(pa_source *s) {
}
pa_usec_t pa_source_get_requested_latency_within_thread(pa_source *s) {
- pa_usec_t result = 0;
+ pa_usec_t result = (pa_usec_t) -1;
pa_source_output *o;
void *state = NULL;
@@ -724,11 +724,11 @@ pa_usec_t pa_source_get_requested_latency_within_thread(pa_source *s) {
while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL)))
- if (o->thread_info.requested_source_latency > 0 &&
- (!result || result > o->thread_info.requested_source_latency))
+ if (o->thread_info.requested_source_latency != (pa_usec_t) -1 &&
+ (result == (pa_usec_t) -1 || result > o->thread_info.requested_source_latency))
result = o->thread_info.requested_source_latency;
- if (result > 0) {
+ if (result != (pa_usec_t) -1) {
if (s->max_latency > 0 && result > s->max_latency)
result = s->max_latency;