summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-03-31 21:36:45 +0200
committerLennart Poettering <lennart@poettering.net>2009-03-31 21:36:45 +0200
commit76c44d104d8f4ec8729f9601bbad828bd39e253c (patch)
treeddaa730f15f8089e66af4d2fdf1478d8fe1b341c
parentcebaa98b384c94c910739691a1901b935b64cb4e (diff)
be a bit more verbose about max_request changes
-rw-r--r--src/pulsecore/protocol-native.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 09ac7d2b..4f1d9b4b 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1495,17 +1495,26 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
/* Called from thread context */
static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) {
playback_stream *s;
- size_t tlength;
+ size_t new_tlength, old_tlength;
pa_sink_input_assert_ref(i);
s = PLAYBACK_STREAM(i->userdata);
playback_stream_assert_ref(s);
- tlength = nbytes+2*pa_memblockq_get_minreq(s->memblockq);
+ old_tlength = pa_memblockq_get_tlength(s->memblockq);
+ new_tlength = nbytes+2*pa_memblockq_get_minreq(s->memblockq);
- if (pa_memblockq_get_tlength(s->memblockq) < tlength) {
- pa_memblockq_set_tlength(s->memblockq, tlength);
- pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UPDATE_TLENGTH, NULL, pa_memblockq_get_tlength(s->memblockq), NULL, NULL);
+ if (old_tlength < new_tlength) {
+ pa_log_debug("max_request changed, trying to update from %zu to %zu.", old_tlength, new_tlength);
+ pa_memblockq_set_tlength(s->memblockq, new_tlength);
+ new_tlength = pa_memblockq_get_tlength(s->memblockq);
+
+ if (new_tlength == old_tlength)
+ pa_log_debug("Failed to increase tlength");
+ else {
+ pa_log_debug("Notifying client about increased tlength");
+ pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UPDATE_TLENGTH, NULL, pa_memblockq_get_tlength(s->memblockq), NULL, NULL);
+ }
}
}