From 5dcdd5e3583f32c8bffb5a1892e318747070f5d8 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sat, 4 Apr 2009 22:56:38 +0300 Subject: perl -p -i -e 's/pa_rtclock_usec/pa_rtclock_now/g' `find . -name '*.[ch]'` --- src/modules/alsa/alsa-sink.c | 12 ++++++------ src/modules/alsa/alsa-source.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 281371f7..37ebe541 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -707,7 +707,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 +721,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 +752,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. */ @@ -1246,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); @@ -1275,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); */ @@ -1581,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( diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 4be27eb0..32510654 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -669,7 +669,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(position, &u->source->sample_spec); @@ -682,7 +682,7 @@ static pa_usec_t source_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) now2 - (int64_t) pa_bytes_to_usec(u->read_count, &u->source->sample_spec); @@ -707,7 +707,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 */ snd_pcm_close(u->pcm_handle); @@ -833,7 +833,7 @@ static int unsuspend(struct userdata *u) { /* FIXME: We need to reload the volume somehow */ snd_pcm_start(u->pcm_handle); - pa_smoother_resume(u->smoother, pa_rtclock_usec(), TRUE); + pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE); pa_log_info("Resumed successfully..."); @@ -1131,7 +1131,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); */ @@ -1431,7 +1431,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p TRUE, TRUE, 5, - pa_rtclock_usec(), + pa_rtclock_now(), FALSE); dev_id = pa_modargs_get_value( -- cgit From 125c52889626b2ac408ecbcc8ea85575f5808e07 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sat, 4 Apr 2009 23:19:53 +0300 Subject: pulse: move pa_rtclock_now in pulsecommon --- src/modules/alsa/alsa-sink.c | 9 +++++---- src/modules/alsa/alsa-source.c | 9 +++++---- src/modules/alsa/module-alsa-source.c | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 37ebe541..9116a69f 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -32,16 +32,18 @@ #include #endif -#include -#include -#include #include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include @@ -50,7 +52,6 @@ #include #include #include -#include #include #include diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 32510654..ede9306f 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -28,10 +28,11 @@ #include -#include -#include -#include #include +#include +#include +#include +#include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +50,6 @@ #include #include #include -#include #include diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c index de8bcd0b..23da4185 100644 --- a/src/modules/alsa/module-alsa-source.c +++ b/src/modules/alsa/module-alsa-source.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -51,7 +52,6 @@ #include #include #include -#include #include "alsa-util.h" #include "alsa-source.h" -- cgit