[pulseaudio-discuss] [PATCH] null-sink: update timestamp when state changes from SUSPENDED to IDLE

Georg Chini georg at chini.tk
Fri Oct 23 03:08:26 PDT 2015


When the null sink changes state from suspended to idle (for example
when attaching a loopback module to the monitor source), u->timestamp
must also be updated.
Thanks to Olivier Delbeke for reporting the bug and teting the patch.

---
 src/modules/module-null-sink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 0270ba2..e6d261a 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -95,6 +95,8 @@ static int sink_process_msg(
 
             if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING)
                 u->timestamp = pa_rtclock_now();
+            if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED && PA_PTR_TO_UINT(data) == PA_SINK_IDLE)
+                u->timestamp = pa_rtclock_now();
 
             break;
 
-- 
2.5.0



More information about the pulseaudio-discuss mailing list