diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-04-22 02:46:19 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-04-22 02:46:19 +0000 |
commit | 4a1971a5351d49d3ff7fa33f386b579f558c2fd0 (patch) | |
tree | df2e786c20ded314076b0bf225e011c3d92c4661 /src | |
parent | 69f6bdf1557fa9d8edd590222c17b5c2450ec8bd (diff) |
if no latency was configure for a sink/source, fill in the max latency automatically
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2295 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r-- | src/pulsecore/sink.c | 3 | ||||
-rw-r--r-- | src/pulsecore/source.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index e88e7d2b..452dab79 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -1298,6 +1298,9 @@ pa_usec_t pa_sink_get_requested_latency(pa_sink *s) { if (pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_REQUESTED_LATENCY, &usec, 0, NULL) < 0) return 0; + if (usec == (pa_usec_t) -1) + usec = s->max_latency; + return usec; } diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index 27279719..dab307e9 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -754,6 +754,9 @@ pa_usec_t pa_source_get_requested_latency(pa_source *s) { if (pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_REQUESTED_LATENCY, &usec, 0, NULL) < 0) return 0; + if (usec == (pa_usec_t) -1) + usec = s->max_latency; + return usec; } |