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

Tanu Kaskinen tanuk at iki.fi
Sat Oct 24 02:16:11 PDT 2015


On Fri, 2015-10-23 at 12:08 +0200, Georg Chini wrote:
> 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;

I guess the goal is that the timestamp should be reset to "now" when
the sink transitions from INIT or SUSPENDED to IDLE or RUNNING, and not
at any other time. Now the timestamp is reset also in the IDLE ->
RUNNING transition, and INIT -> IDLE isn't handled. I guess this should
be changed?

-- 
Tanu


More information about the pulseaudio-discuss mailing list