static void pulse_get_output_timestamp(AVFormatContext *h, int stream, int64_t *dts, int64_t *wall)

{

    PulseData *s = h->priv_data;

    pa_usec_t latency;

    int neg;

    pa_threaded_mainloop_lock(s->mainloop);

    pa_stream_get_latency(s->stream, &latency, &neg);

    pa_threaded_mainloop_unlock(s->mainloop);

    *wall = av_gettime();

    *dts = s->timestamp - (neg ? -latency : latency);

}

static void pulse_get_output_timestamp(AVFormatContext *h, int stream, int64_t *dts, int64_t *wall)

{

    PulseData *s = h->priv_data;

    pa_usec_t latency;

    int neg;

    pa_threaded_mainloop_lock(s->mainloop);

    pa_stream_get_latency(s->stream, &latency, &neg);

    pa_threaded_mainloop_unlock(s->mainloop);

    *wall = av_gettime();

    *dts = s->timestamp - (neg ? -latency : latency);

}

static void FUNC_0(AVFormatContext *VAR_0, int VAR_1, int64_t *VAR_2, int64_t *VAR_3)

{

    PulseData *s = VAR_0->priv_data;

    pa_usec_t latency;

    int VAR_4;

    pa_threaded_mainloop_lock(s->mainloop);

    pa_stream_get_latency(s->VAR_1, &latency, &VAR_4);

    pa_threaded_mainloop_unlock(s->mainloop);

    *VAR_3 = av_gettime();

    *VAR_2 = s->timestamp - (VAR_4 ? -latency : latency);

}

static void FUNC_0(AVFormatContext *VAR_0, int VAR_1, int64_t *VAR_2, int64_t *VAR_3)
{ PulseData *s = VAR_0->priv_data; pa_usec_t latency; int VAR_4; pa_threaded_mainloop_lock(s->mainloop); pa_stream_get_latency(s->VAR_1, &latency, &VAR_4); pa_threaded_mainloop_unlock(s->mainloop); *VAR_3 = av_gettime(); *VAR_2 = s->timestamp - (VAR_4 ? -latency : latency); }