From 350a2bc846559bb274ba70f928bb42a9472050bf Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 15 Aug 2009 00:48:14 +0200 Subject: core: make fixed latency dynamically changeable This of course makes the name 'fixed' a bit of a misnomer. However the definitions are now like this: fixed latency: the latency may change during runtime, but is solely controlled by the backend, the client has no influence. dynamic latency: the latency may change during runtime, influenced by the requests of the clients. i.e. fixed vs. dynamic is from the perspective of the client. --- src/pulsecore/source-output.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/pulsecore/source-output.c') diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c index 2b3a0c58..3803a6cc 100644 --- a/src/pulsecore/source-output.c +++ b/src/pulsecore/source-output.c @@ -84,6 +84,7 @@ static void reset_callbacks(pa_source_output *o) { o->update_max_rewind = NULL; o->update_source_requested_latency = NULL; o->update_source_latency_range = NULL; + o->update_source_fixed_latency = NULL; o->attach = NULL; o->detach = NULL; o->suspend = NULL; @@ -561,13 +562,13 @@ pa_usec_t pa_source_output_set_requested_latency_within_thread(pa_source_output pa_source_output_assert_io_context(o); if (!(o->source->flags & PA_SOURCE_DYNAMIC_LATENCY)) - usec = o->source->fixed_latency; + usec = o->source->thread_info.fixed_latency; if (usec != (pa_usec_t) -1) usec = PA_CLAMP(usec, o->source->thread_info.min_latency, o->source->thread_info.max_latency); o->thread_info.requested_source_latency = usec; - pa_source_invalidate_requested_latency(o->source); + pa_source_invalidate_requested_latency(o->source, TRUE); return usec; } @@ -587,7 +588,7 @@ pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t if (o->source) { if (!(o->source->flags & PA_SOURCE_DYNAMIC_LATENCY)) - usec = o->source->fixed_latency; + usec = pa_source_get_fixed_latency(o->source); if (usec != (pa_usec_t) -1) { pa_usec_t min_latency, max_latency; -- cgit