summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2015-10-24 13:00:39 +0200
committerArun Raghavan <git@arunraghavan.net>2015-10-30 17:58:03 +0530
commit4e2fae5719faf478eda5ac4d9aed3dd29c1c26a9 (patch)
treed381010d3dd76a4675d0991c08dcfd1450a9d3d6
parentc01e70ec67807bd3b6f6e330fd498353562c3d8c (diff)
downloadpulseaudio-4e2fae5719faf478eda5ac4d9aed3dd29c1c26a9.tar.gz
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
-rw-r--r--src/modules/module-null-sink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 0270ba2ea..5b98ba5cb 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;