[pulseaudio-commits] src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Sun Oct 25 07:37:12 PDT 2015


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

New commits:
commit 2902cdc4ca6416ec85ce32a76fac2a99910aaee8
Author: Georg Chini <georg at chini.tk>
Date:   Sat Oct 24 13:00:39 2015 +0200

    null-sink: correct update of timestamp when state changes to RUNNING or IDLE
    
    u->timestamp should be reset to "now" when the sink state changes from
    INIT or SUSPENDED to IDLE or RUNNING.
    Thanks to Olivier Delbeke for reporting the bug and testing the patch.
    Bug report is here:
    http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024553.html

diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 0270ba2..5b98ba5 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -93,8 +93,10 @@ static int sink_process_msg(
     switch (code) {
         case PA_SINK_MESSAGE_SET_STATE:
 
-            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_sink_get_state(u->sink) == PA_SINK_INIT) {
+                if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING || PA_PTR_TO_UINT(data) == PA_SINK_IDLE)
+                    u->timestamp = pa_rtclock_now();
+            }
 
             break;
 



More information about the pulseaudio-commits mailing list