summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/source.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-05-08 01:56:21 +0200
committerColin Guthrie <cguthrie@mandriva.org>2009-06-08 22:31:51 +0100
commitc2a3d914804cd5c72463f41a21ff5cff5334b619 (patch)
tree8f69e9b24ea933e3b63db3361bf02f758f069344 /src/pulsecore/source.c
parent7e664dc56a1f2ce385f6f7739209ef2413974d8f (diff)
core: introduce pa_{sink,source}_set_fixed_latency()
This allows us to forward the fixed latency directly from the sink to the monitor source withut having to wait for pa_sink_put().
Diffstat (limited to 'src/pulsecore/source.c')
-rw-r--r--src/pulsecore/source.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 0baaed11..e8deaf7f 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1280,6 +1280,21 @@ void pa_source_set_latency_range_within_thread(pa_source *s, pa_usec_t min_laten
pa_source_invalidate_requested_latency(s);
}
+/* Called from main thread, before the source is put */
+void pa_source_set_fixed_latency(pa_source *s, pa_usec_t latency) {
+ pa_source_assert_ref(s);
+
+ pa_assert(pa_source_get_state(s) == PA_SOURCE_INIT);
+
+ if (latency < ABSOLUTE_MIN_LATENCY)
+ latency = ABSOLUTE_MIN_LATENCY;
+
+ if (latency > ABSOLUTE_MAX_LATENCY)
+ latency = ABSOLUTE_MAX_LATENCY;
+
+ s->fixed_latency = latency;
+}
+
/* Called from main thread */
size_t pa_source_get_max_rewind(pa_source *s) {
size_t r;