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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux