summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-23 22:34:42 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-23 22:34:42 +0200
commit80c693730365c1a375a5c0e781f38e7f165b37bf (patch)
treeb3a69ece653141152566ab3f20c0b7da15c61dbd /src/modules/alsa/alsa-sink.c
parenta0f01ddc951694e1d13f44dc3a5d0d3fb2daa142 (diff)
alsa: increase interval between smoother updates exponentially for alsa sources, following the scheme for sinks
Diffstat (limited to 'src/modules/alsa/alsa-sink.c')
-rw-r--r--src/modules/alsa/alsa-sink.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index c3694729..b99ed782 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -733,10 +733,9 @@ static void update_smoother(struct userdata *u) {
now1 = pa_rtclock_now();
/* check if the time since the last update is bigger than the interval */
- if (u->last_smoother_update > 0) {
+ if (u->last_smoother_update > 0)
if (u->last_smoother_update + u->smoother_interval > now1)
return;
- }
position = (int64_t) u->write_count - ((int64_t) delay * (int64_t) u->frame_size);
@@ -745,11 +744,11 @@ static void update_smoother(struct userdata *u) {
now2 = pa_bytes_to_usec((uint64_t) position, &u->sink->sample_spec);
+ pa_smoother_put(u->smoother, now1, now2);
+
u->last_smoother_update = now1;
/* exponentially increase the update interval up to the MAX limit */
u->smoother_interval = PA_MIN (u->smoother_interval * 2, SMOOTHER_MAX_INTERVAL);
-
- pa_smoother_put(u->smoother, now1, now2);
}
static pa_usec_t sink_get_latency(struct userdata *u) {
@@ -927,7 +926,6 @@ static int unsuspend(struct userdata *u) {
u->first = TRUE;
u->since_start = 0;
-
pa_log_info("Resumed successfully...");
return 0;