From: Lennart Poettering Date: Sat, 17 May 2008 09:12:45 +0000 (+0000) Subject: add new function pa_source_set_latency_range(), fix type of requested_latency X-Git-Tag: v0.9.11~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b44665c08529081bc3960979e8f0ecace0059d5;p=platform%2Fupstream%2Fpulseaudio.git add new function pa_source_set_latency_range(), fix type of requested_latency git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2456 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index c767abc..9425193 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -786,4 +786,23 @@ void pa_source_invalidate_requested_latency(pa_source *s) { if (s->update_requested_latency) s->update_requested_latency(s); + + if (s->monitor_of) + pa_sink_invalidate_requested_latency(s->monitor_of); +} + +void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t max_latency) { + pa_source_assert_ref(s); + + if (min_latency == (pa_usec_t) -1) + min_latency = DEFAULT_MIN_LATENCY; + + if (max_latency == (pa_usec_t) -1) + max_latency = min_latency; + + pa_assert(!min_latency || !max_latency || + min_latency <= max_latency); + + s->min_latency = min_latency; + s->max_latency = max_latency; } diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h index f9c9cbf..d12659d 100644 --- a/src/pulsecore/source.h +++ b/src/pulsecore/source.h @@ -111,7 +111,7 @@ struct pa_source { pa_bool_t soft_muted; pa_bool_t requested_latency_valid; - size_t requested_latency; + pa_usec_t requested_latency; /* Then number of bytes this source will be rewound for at * max */ @@ -180,6 +180,8 @@ void pa_source_set_description(pa_source *s, const char *description); void pa_source_set_asyncmsgq(pa_source *s, pa_asyncmsgq *q); void pa_source_set_rtpoll(pa_source *s, pa_rtpoll *p); +void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t max_latency); + void pa_source_detach(pa_source *s); void pa_source_attach(pa_source *s);