[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. 98c26b179d7d5dd331bbc77288901983246d84dc

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Jun 27 16:09:10 PDT 2008


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  e6ffec578de115ad63157a5a93ac1e6f3fc5ed59 (commit)

- Log -----------------------------------------------------------------
98c26b1... add proper update_max_request handler to native protocol streams
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/protocol-native.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------

commit 98c26b179d7d5dd331bbc77288901983246d84dc
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jun 28 01:09:07 2008 +0200

    add proper update_max_request handler to native protocol streams

diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index cd3056d..e130359 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -211,7 +211,7 @@ static void sink_input_suspend_cb(pa_sink_input *i, pa_bool_t suspend);
 static void sink_input_moved_cb(pa_sink_input *i);
 static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes);
 static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes);
-
+static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes);
 
 static void send_memblock(connection *c);
 static void request_bytes(struct playback_stream*s);
@@ -808,6 +808,8 @@ static void fix_playback_buffer_attr_pre(playback_stream *s, pa_bool_t adjust_la
             tlength_usec -= s->sink_latency;
     }
 
+    /* FIXME: This is actually larger than necessary, since not all of
+     * the sink latency is actually rewritable. */
     if (tlength_usec < s->sink_latency + 2*minreq_usec)
         tlength_usec = s->sink_latency + 2*minreq_usec;
 
@@ -929,6 +931,7 @@ static playback_stream* playback_stream_new(
     s->sink_input->pop = sink_input_pop_cb;
     s->sink_input->process_rewind = sink_input_process_rewind_cb;
     s->sink_input->update_max_rewind = sink_input_update_max_rewind_cb;
+    s->sink_input->update_max_request = sink_input_update_max_request_cb;
     s->sink_input->kill = sink_input_kill_cb;
     s->sink_input->moved = sink_input_moved_cb;
     s->sink_input->suspend = sink_input_suspend_cb;
@@ -1356,6 +1359,20 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
     pa_memblockq_set_maxrewind(s->memblockq, nbytes);
 }
 
+static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) {
+    playback_stream *s;
+    size_t 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);
+
+    if (pa_memblockq_get_tlength(s->memblockq) < tlength)
+        pa_memblockq_set_tlength(s->memblockq, tlength);
+}
+
 /* Called from main context */
 static void sink_input_kill_cb(pa_sink_input *i) {
     playback_stream *s;

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list