summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/sink.c15
-rw-r--r--src/pulsecore/sink.h2
-rw-r--r--src/pulsecore/source.c15
3 files changed, 9 insertions, 23 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a3bf03a6..1fec0189 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -49,7 +49,6 @@
#define MAX_MIX_CHANNELS 32
#define MIX_BUFFER_LENGTH (PA_PAGE_SIZE)
#define ABSOLUTE_MIN_LATENCY (500)
-#define DEFAULT_MIN_LATENCY (4*PA_USEC_PER_MSEC)
#define ABSOLUTE_MAX_LATENCY (10*PA_USEC_PER_SEC)
static PA_DEFINE_CHECK_TYPE(pa_sink, pa_msgobject);
@@ -232,8 +231,8 @@ pa_sink* pa_sink_new(
s->thread_info.max_request = 0;
s->thread_info.requested_latency_valid = FALSE;
s->thread_info.requested_latency = 0;
- s->thread_info.min_latency = DEFAULT_MIN_LATENCY;
- s->thread_info.max_latency = DEFAULT_MIN_LATENCY;
+ s->thread_info.min_latency = ABSOLUTE_MIN_LATENCY;
+ s->thread_info.max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert_se(pa_idxset_put(core->sinks, s, &s->index) >= 0);
@@ -1857,21 +1856,15 @@ void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_
pa_sink_assert_ref(s);
/* min_latency == 0: no limit
- * min_latency == (size_t) -1: default limit
* min_latency anything else: specified limit
*
* Similar for max_latency */
- if (min_latency == (pa_usec_t) -1)
- min_latency = DEFAULT_MIN_LATENCY;
-
if (min_latency < ABSOLUTE_MIN_LATENCY)
min_latency = ABSOLUTE_MIN_LATENCY;
- if (max_latency == (pa_usec_t) -1)
- max_latency = min_latency;
-
- if (max_latency > ABSOLUTE_MAX_LATENCY || max_latency <= 0)
+ if (max_latency <= 0 ||
+ max_latency > ABSOLUTE_MAX_LATENCY)
max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert(min_latency <= max_latency);
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index f3f25427..7d1e11ef 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -219,9 +219,9 @@ void pa_sink_unlink(pa_sink* s);
void pa_sink_set_description(pa_sink *s, const char *description);
void pa_sink_set_asyncmsgq(pa_sink *s, pa_asyncmsgq *q);
void pa_sink_set_rtpoll(pa_sink *s, pa_rtpoll *p);
+
void pa_sink_set_max_rewind(pa_sink *s, size_t max_rewind);
void pa_sink_set_max_request(pa_sink *s, size_t max_request);
-
void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_latency);
void pa_sink_detach(pa_sink *s);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index da3ae794..6e5bf1ff 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -42,7 +42,6 @@
#include "source.h"
#define ABSOLUTE_MIN_LATENCY (500)
-#define DEFAULT_MIN_LATENCY (4*PA_USEC_PER_MSEC)
#define ABSOLUTE_MAX_LATENCY (10*PA_USEC_PER_SEC)
static PA_DEFINE_CHECK_TYPE(pa_source, pa_msgobject);
@@ -220,8 +219,8 @@ pa_source* pa_source_new(
s->thread_info.max_rewind = 0;
s->thread_info.requested_latency_valid = FALSE;
s->thread_info.requested_latency = 0;
- s->thread_info.min_latency = DEFAULT_MIN_LATENCY;
- s->thread_info.max_latency = DEFAULT_MIN_LATENCY;
+ s->thread_info.min_latency = ABSOLUTE_MIN_LATENCY;
+ s->thread_info.max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert_se(pa_idxset_put(core->sources, s, &s->index) >= 0);
@@ -1124,21 +1123,15 @@ void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t
pa_source_assert_ref(s);
/* min_latency == 0: no limit
- * min_latency == (size_t) -1: default limit
* min_latency anything else: specified limit
*
* Similar for max_latency */
- if (min_latency == (pa_usec_t) -1)
- min_latency = DEFAULT_MIN_LATENCY;
-
if (min_latency < ABSOLUTE_MIN_LATENCY)
min_latency = ABSOLUTE_MIN_LATENCY;
- if (max_latency == (pa_usec_t) -1)
- max_latency = min_latency;
-
- if (max_latency > ABSOLUTE_MAX_LATENCY || max_latency <= 0)
+ if (max_latency <= 0 ||
+ max_latency > ABSOLUTE_MAX_LATENCY)
max_latency = ABSOLUTE_MAX_LATENCY;
pa_assert(min_latency <= max_latency);