diff options
| author | Lennart Poettering <lennart@poettering.net> | 2009-11-20 19:48:08 +0100 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2009-11-23 05:03:22 +0100 | 
| commit | c13bf3dd5514d3392f9106330b8bd30b345e5f07 (patch) | |
| tree | 6cad8b6f3e642fb31ddfaa370691e73ad6f1890d | |
| parent | d6a851cd1609a39053d5ef34c180b9d07d56bf86 (diff) | |
pulse: delay smoother update only when unpausing, not when pausing, since we don't want the timer to advance when we are supposedly already paused
| -rw-r--r-- | src/pulse/stream.c | 36 | 
1 files changed, 19 insertions, 17 deletions
| diff --git a/src/pulse/stream.c b/src/pulse/stream.c index 5e53570e..305e35bb 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -376,22 +376,6 @@ static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t      if (!s->smoother)          return; -    if (!s->timing_info_valid && -        !aposteriori && -        !force_start && -        !force_stop && -        s->context->version >= 13) { - -        /* If the server supports STARTED and UNDERFLOW events we take -         * them as indications when audio really starts/stops playing, -         * if we don't have any timing info yet -- instead of trying -         * to be smart and guessing the server time. Otherwise the -         * unknown transport delay we don't know might add too much -         * noise to our time calculations. */ - -        return; -    } -      x = pa_rtclock_now();      if (s->timing_info_valid) { @@ -403,8 +387,26 @@ static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t      if (s->suspended || s->corked || force_stop)          pa_smoother_pause(s->smoother, x); -    else if (force_start || s->buffer_attr.prebuf == 0) +    else if (force_start || s->buffer_attr.prebuf == 0) { + +        if (!s->timing_info_valid && +            !aposteriori && +            !force_start && +            !force_stop && +            s->context->version >= 13) { + +            /* If the server supports STARTED events we take them as +             * indications when audio really starts/stops playing, if +             * we don't have any timing info yet -- instead of trying +             * to be smart and guessing the server time. Otherwise the +             * unknown transport delay add too much noise to our time +             * calculations. */ + +            return; +        } +          pa_smoother_resume(s->smoother, x, TRUE); +    }      /* Please note that we have no idea if playback actually started       * if prebuf is non-zero! */ | 
