[pulseaudio-commits] 2 commits - configure.ac src/daemon src/pulsecore
Arun Raghavan
arun at kemper.freedesktop.org
Sat Jun 18 10:58:59 PDT 2011
configure.ac | 4 +++-
src/daemon/daemon-conf.c | 4 +++-
src/pulsecore/protocol-native.c | 16 ++++++++++++----
3 files changed, 18 insertions(+), 6 deletions(-)
New commits:
commit a13da4e93eac1021278e8195c64d9501d7c2d0ef
Author: Fritz Elfert <fritz at fritz-elfert.de>
Date: Sat Jun 18 01:10:57 2011 +0200
Disable check for pthreads on win32
And do not use sched_get_priority on mingw with win32 pthreads installed
diff --git a/configure.ac b/configure.ac
index 56d4e63..162b383 100644
--- a/configure.ac
+++ b/configure.ac
@@ -433,7 +433,9 @@ AC_CHECK_DEFINE([INADDR_NONE], [netinet/in.h], [],
#### POSIX threads ####
-ACX_PTHREAD
+# Win32 build breaks with win32 pthread installed
+AS_IF([test "x$os_is_win32" != "x1"],
+ [ACX_PTHREAD])
#### Check for libs ####
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 633c315..67b772a 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -478,11 +478,13 @@ static int parse_rtprio(const char *filename, unsigned line, const char *section
pa_assert(rvalue);
pa_assert(data);
-#ifdef HAVE_SCHED_H
+#ifndef OS_IS_WIN32
+# ifdef HAVE_SCHED_H
if (pa_atoi(rvalue, &rtprio) < 0 || rtprio < sched_get_priority_min(SCHED_FIFO) || rtprio > sched_get_priority_max(SCHED_FIFO)) {
pa_log("[%s:%u] Invalid realtime priority '%s'.", filename, line, rvalue);
return -1;
}
+# endif
#endif
c->realtime_priority = (int) rtprio;
commit 7f48b797581e3559f97814433cf65338e4ea0f28
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date: Tue Jun 14 16:38:02 2011 -0700
protocol-native: Use original requested latency on stream moves
We were calculating new latency based on the latency set on the old
sink/source, rather than the actual latency requested by the client.
Over a series of moves, this will lead the latency being ~halved each
time, resulting in an eventual rewind flood from a latency that cannot
be handled.
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index e0a195e..d8df860 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -87,6 +87,9 @@ typedef struct record_stream {
pa_bool_t adjust_latency:1;
pa_bool_t early_requests:1;
+ /* Requested buffer attributes */
+ pa_buffer_attr buffer_attr_req;
+ /* Fixed-up and adjusted buffer attributes */
pa_buffer_attr buffer_attr;
pa_atomic_t on_the_fly;
@@ -132,6 +135,9 @@ typedef struct playback_stream {
pa_atomic_t missing;
pa_usec_t configured_sink_latency;
+ /* Requested buffer attributes */
+ pa_buffer_attr buffer_attr_req;
+ /* Fixed-up and adjusted buffer attributes */
pa_buffer_attr buffer_attr;
/* Only updated after SINK_INPUT_MESSAGE_UPDATE_LATENCY */
@@ -526,6 +532,7 @@ static void fix_record_buffer_attr_pre(record_stream *s) {
* ->thread_info data! */
frame_size = pa_frame_size(&s->source_output->sample_spec);
+ s->buffer_attr = s->buffer_attr_req;
if (s->buffer_attr.maxlength == (uint32_t) -1 || s->buffer_attr.maxlength > MAX_MEMBLOCKQ_LENGTH)
s->buffer_attr.maxlength = MAX_MEMBLOCKQ_LENGTH;
@@ -666,7 +673,7 @@ static record_stream* record_stream_new(
s->parent.process_msg = record_stream_process_msg;
s->connection = c;
s->source_output = source_output;
- s->buffer_attr = *attr;
+ s->buffer_attr_req = *attr;
s->adjust_latency = adjust_latency;
s->early_requests = early_requests;
pa_atomic_store(&s->on_the_fly, 0);
@@ -881,6 +888,7 @@ static void fix_playback_buffer_attr(playback_stream *s) {
* ->thread_info data, such as the memblockq! */
frame_size = pa_frame_size(&s->sink_input->sample_spec);
+ s->buffer_attr = s->buffer_attr_req;
if (s->buffer_attr.maxlength == (uint32_t) -1 || s->buffer_attr.maxlength > MAX_MEMBLOCKQ_LENGTH)
s->buffer_attr.maxlength = MAX_MEMBLOCKQ_LENGTH;
@@ -1105,7 +1113,7 @@ static playback_stream* playback_stream_new(
s->is_underrun = TRUE;
s->drain_request = FALSE;
pa_atomic_store(&s->missing, 0);
- s->buffer_attr = *a;
+ s->buffer_attr_req = *a;
s->adjust_latency = adjust_latency;
s->early_requests = early_requests;
pa_atomic_store(&s->seek_or_post_in_queue, 0);
@@ -3790,7 +3798,7 @@ static void command_set_stream_buffer_attr(pa_pdispatch *pd, uint32_t command, u
s->adjust_latency = adjust_latency;
s->early_requests = early_requests;
- s->buffer_attr = a;
+ s->buffer_attr_req = a;
fix_playback_buffer_attr(s);
pa_assert_se(pa_asyncmsgq_send(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_UPDATE_BUFFER_ATTR, NULL, 0, NULL) == 0);
@@ -3826,7 +3834,7 @@ static void command_set_stream_buffer_attr(pa_pdispatch *pd, uint32_t command, u
s->adjust_latency = adjust_latency;
s->early_requests = early_requests;
- s->buffer_attr = a;
+ s->buffer_attr_req = a;
fix_record_buffer_attr_pre(s);
pa_memblockq_set_maxlength(s->memblockq, s->buffer_attr.maxlength);
More information about the pulseaudio-commits
mailing list