diff options
Diffstat (limited to 'src/pulse/stream.c')
-rw-r--r-- | src/pulse/stream.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/pulse/stream.c b/src/pulse/stream.c index 0d62b1203..20ef92fd3 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -389,10 +389,37 @@ static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t x = pa_rtclock_now(); if (s->timing_info_valid) { + //x = s->last_start; + if (aposteriori) x -= i->transport_usec; else x += i->transport_usec; + +#if 0 + if (s->direction == PA_STREAM_PLAYBACK && s->context->version >= 13) { + pa_usec_t su; + + /* If we weren't playing then it will take some time + * until the audio will actually come out through the + * speakers. Since we follow that timing here, we need + * to try to fix this up */ + + pa_log_debug("sink_usec %llu, since underrun %lld", i->sink_usec, i->since_underrun); + + if (i->since_underrun > 0) + su = pa_bytes_to_usec((uint64_t) i->since_underrun, &s->sample_spec); + else + su = 0; + + pa_log_debug("su %llu", su); + + if (su < i->sink_usec) + x += i->sink_usec - su; + + pa_log_debug("x %llu", x); + } +#endif } if (s->suspended || s->corked || force_stop) @@ -412,6 +439,7 @@ static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t * unknown transport delay add too much noise to our time * calculations. */ + pa_log_debug("not resuming yet"); return; } @@ -1776,6 +1804,9 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command, pa_log_debug("x %llu", x); } + ///* save when we estimate the start */ + //o->stream->last_start = x; + if (!i->playing) pa_smoother_pause(o->stream->smoother, x); |