summaryrefslogtreecommitdiff
path: root/src/modules/module-null-sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-04-07 00:47:55 +0200
committerLennart Poettering <lennart@poettering.net>2009-04-07 00:47:55 +0200
commit298bd0b0c674206f2ba7071943164c2cf699cbf3 (patch)
treed69714c283bae2d97fd55ab18471c079ccfd0066 /src/modules/module-null-sink.c
parente976034063863a644a7ebdf1165403a81656d7c3 (diff)
adjust max_rewind/max_request whenever the latency changes
Diffstat (limited to 'src/modules/module-null-sink.c')
-rw-r--r--src/modules/module-null-sink.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 129bc1c3..9254242a 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -119,6 +119,7 @@ static int sink_process_msg(
static void sink_update_requested_latency_cb(pa_sink *s) {
struct userdata *u;
+ size_t nbytes;
pa_sink_assert_ref(s);
pa_assert_se(u = s->userdata);
@@ -127,6 +128,10 @@ static void sink_update_requested_latency_cb(pa_sink *s) {
if (u->block_usec == (pa_usec_t) -1)
u->block_usec = s->thread_info.max_latency;
+
+ nbytes = pa_usec_to_bytes(u->block_usec, &s->sample_spec);
+ pa_sink_set_max_rewind_within_thread(s, nbytes);
+ pa_sink_set_max_request_within_thread(s, nbytes);
}
static void process_rewind(struct userdata *u, pa_usec_t now) {