summaryrefslogtreecommitdiff
path: root/src/pulsecore
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2017-04-10 21:47:23 +0200
committerGeorg Chini <georg@chini.tk>2017-04-10 21:47:23 +0200
commit5bc363d4b84ccbb07727d7d0603598a3b664b1b1 (patch)
tree8f10a240becb494f6d94296f7a59bf22b0815af1 /src/pulsecore
parent6f2e22e7ad5671f687687ff2a8d66b95a7a30bef (diff)
loopback: Add hooks to track port latency offsets
The previous patch assumed constant port latency offsets. The offsets can however be changed by the user, therefore these changes need to be tracked as well. This patch adds the necessary hooks. Also the print_msg argument was removed from update_minimum_latency() and update_latency_boundaries() because the message should always be logged.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/core.h2
-rw-r--r--src/pulsecore/sink.c2
-rw-r--r--src/pulsecore/source.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 212f6f71..df71a118 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -75,6 +75,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SINK_FLAGS_CHANGED,
PA_CORE_HOOK_SINK_VOLUME_CHANGED,
PA_CORE_HOOK_SINK_MUTE_CHANGED,
+ PA_CORE_HOOK_SINK_PORT_LATENCY_OFFSET_CHANGED,
PA_CORE_HOOK_SOURCE_NEW,
PA_CORE_HOOK_SOURCE_FIXATE,
PA_CORE_HOOK_SOURCE_PUT,
@@ -86,6 +87,7 @@ typedef enum pa_core_hook {
PA_CORE_HOOK_SOURCE_FLAGS_CHANGED,
PA_CORE_HOOK_SOURCE_VOLUME_CHANGED,
PA_CORE_HOOK_SOURCE_MUTE_CHANGED,
+ PA_CORE_HOOK_SOURCE_PORT_LATENCY_OFFSET_CHANGED,
PA_CORE_HOOK_SINK_INPUT_NEW,
PA_CORE_HOOK_SINK_INPUT_FIXATE,
PA_CORE_HOOK_SINK_INPUT_PUT,
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index fb16d574..39689437 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -3295,6 +3295,8 @@ void pa_sink_set_port_latency_offset(pa_sink *s, int64_t offset) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_PORT_LATENCY_OFFSET, NULL, offset, NULL) == 0);
else
s->thread_info.port_latency_offset = offset;
+
+ pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_PORT_LATENCY_OFFSET_CHANGED], s);
}
/* Called from main context */
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 09c953f1..14250825 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -2586,6 +2586,8 @@ void pa_source_set_port_latency_offset(pa_source *s, int64_t offset) {
pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_PORT_LATENCY_OFFSET, NULL, offset, NULL) == 0);
else
s->thread_info.port_latency_offset = offset;
+
+ pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_PORT_LATENCY_OFFSET_CHANGED], s);
}
/* Called from main thread */