diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-06-22 23:09:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-06-22 23:09:46 +0200 |
commit | fc33f7ee97da6a8b7263620775b7b74b4c754402 (patch) | |
tree | 519635b1f72acc7613b4b7c4ad70fbc39ab3901b /src/modules/alsa/alsa-sink.c | |
parent | 048e576a6dfe2bfe62fa33c74c30cc34057ee740 (diff) | |
parent | e4d914c945c13d23b131d7ba75fbdd03cb6d0043 (diff) |
Merge most of elmarco/rtclock2
Merge commit 'e4d914c945c13d23b131d7ba75fbdd03cb6d0043'
Diffstat (limited to 'src/modules/alsa/alsa-sink.c')
-rw-r--r-- | src/modules/alsa/alsa-sink.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index c39a898f..c584362d 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -32,16 +32,18 @@ #include <valgrind/memcheck.h> #endif -#include <pulse/xmalloc.h> -#include <pulse/util.h> -#include <pulse/timeval.h> #include <pulse/i18n.h> +#include <pulse/rtclock.h> +#include <pulse/timeval.h> +#include <pulse/util.h> +#include <pulse/xmalloc.h> #include <pulsecore/core.h> #include <pulsecore/module.h> #include <pulsecore/memchunk.h> #include <pulsecore/sink.h> #include <pulsecore/modargs.h> +#include <pulsecore/core-rtclock.h> #include <pulsecore/core-util.h> #include <pulsecore/sample-util.h> #include <pulsecore/log.h> @@ -50,7 +52,6 @@ #include <pulsecore/core-error.h> #include <pulsecore/thread-mq.h> #include <pulsecore/rtpoll.h> -#include <pulsecore/rtclock.h> #include <pulsecore/time-smoother.h> #include <modules/reserve-wrap.h> @@ -707,7 +708,7 @@ static void update_smoother(struct userdata *u) { /* Hmm, if the timestamp is 0, then it wasn't set and we take the current time */ if (now1 <= 0) - now1 = pa_rtclock_usec(); + now1 = pa_rtclock_now(); now2 = pa_bytes_to_usec((uint64_t) position, &u->sink->sample_spec); @@ -721,7 +722,7 @@ static pa_usec_t sink_get_latency(struct userdata *u) { pa_assert(u); - now1 = pa_rtclock_usec(); + now1 = pa_rtclock_now(); now2 = pa_smoother_get(u->smoother, now1); delay = (int64_t) pa_bytes_to_usec(u->write_count, &u->sink->sample_spec) - (int64_t) now2; @@ -752,7 +753,7 @@ static int suspend(struct userdata *u) { pa_assert(u); pa_assert(u->pcm_handle); - pa_smoother_pause(u->smoother, pa_rtclock_usec()); + pa_smoother_pause(u->smoother, pa_rtclock_now()); /* Let's suspend -- we don't call snd_pcm_drain() here since that might * take awfully long with our long buffer sizes today. */ @@ -1245,7 +1246,7 @@ static void thread_func(void *userdata) { pa_log_info("Starting playback."); snd_pcm_start(u->pcm_handle); - pa_smoother_resume(u->smoother, pa_rtclock_usec(), TRUE); + pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE); } update_smoother(u); @@ -1274,7 +1275,7 @@ static void thread_func(void *userdata) { /* Convert from the sound card time domain to the * system time domain */ - cusec = pa_smoother_translate(u->smoother, pa_rtclock_usec(), sleep_usec); + cusec = pa_smoother_translate(u->smoother, pa_rtclock_now(), sleep_usec); /* pa_log_debug("Waking up in %0.2fms (system clock).", (double) cusec / PA_USEC_PER_MSEC); */ @@ -1580,7 +1581,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca TRUE, TRUE, 5, - pa_rtclock_usec(), + pa_rtclock_now(), TRUE); dev_id = pa_modargs_get_value( |