summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorMarc-André Lureau <marc-andre.lureau@nokia.com>2009-04-04 22:56:38 +0300
committerMarc-André Lureau <marcandre.lureau@gmail.com>2009-06-19 19:04:04 +0300
commit5dcdd5e3583f32c8bffb5a1892e318747070f5d8 (patch)
tree63855e8da31b296cf016ec813980744f84a0ca4d /src/modules
parent6ad38556395fa1ee2020abb258e5f814fef8ad34 (diff)
perl -p -i -e 's/pa_rtclock_usec/pa_rtclock_now/g' `find . -name '*.[ch]'`
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/alsa/alsa-sink.c12
-rw-r--r--src/modules/alsa/alsa-source.c12
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c18
-rw-r--r--src/modules/module-combine.c12
-rw-r--r--src/modules/module-esound-sink.c10
-rw-r--r--src/modules/module-null-sink.c8
-rw-r--r--src/modules/module-sine-source.c8
-rw-r--r--src/modules/module-solaris.c2
-rw-r--r--src/modules/module-tunnel.c12
-rw-r--r--src/modules/raop/module-raop-sink.c10
-rw-r--r--src/modules/rtp/module-rtp-recv.c2
11 files changed, 53 insertions, 53 deletions
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(
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 6bcd0b80..e0d4e481 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -773,7 +773,7 @@ static int start_stream_fd(struct userdata *u) {
TRUE,
TRUE,
10,
- pa_rtclock_usec(),
+ pa_rtclock_now(),
TRUE);
return 0;
@@ -867,14 +867,14 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
if (u->read_smoother) {
pa_usec_t wi, ri;
- ri = pa_smoother_get(u->read_smoother, pa_rtclock_usec());
+ ri = pa_smoother_get(u->read_smoother, pa_rtclock_now());
wi = pa_bytes_to_usec(u->write_index + u->block_size, &u->sample_spec);
*((pa_usec_t*) data) = wi > ri ? wi - ri : 0;
} else {
pa_usec_t ri, wi;
- ri = pa_rtclock_usec() - u->started_at;
+ ri = pa_rtclock_now() - u->started_at;
wi = pa_bytes_to_usec(u->write_index, &u->sample_spec);
*((pa_usec_t*) data) = wi > ri ? wi - ri : 0;
@@ -912,7 +912,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
stop_stream_fd(u);
if (u->read_smoother)
- pa_smoother_pause(u->read_smoother, pa_rtclock_usec());
+ pa_smoother_pause(u->read_smoother, pa_rtclock_now());
break;
case PA_SOURCE_IDLE:
@@ -939,7 +939,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
case PA_SOURCE_MESSAGE_GET_LATENCY: {
pa_usec_t wi, ri;
- wi = pa_smoother_get(u->read_smoother, pa_rtclock_usec());
+ wi = pa_smoother_get(u->read_smoother, pa_rtclock_now());
ri = pa_bytes_to_usec(u->read_index, &u->sample_spec);
*((pa_usec_t*) data) = (wi > ri ? wi - ri : 0) + u->source->fixed_latency;
@@ -1086,7 +1086,7 @@ static int hsp_process_push(struct userdata *u) {
if (!found_tstamp) {
pa_log_warn("Couldn't find SO_TIMESTAMP data in auxiliary recvmsg() data!");
- tstamp = pa_rtclock_usec();
+ tstamp = pa_rtclock_now();
}
pa_smoother_put(u->read_smoother, tstamp, pa_bytes_to_usec(u->read_index, &u->sample_spec));
@@ -1309,7 +1309,7 @@ static void thread_func(void *userdata) {
/* Hmm, there is no input stream we could synchronize
* to. So let's do things by time */
- time_passed = pa_rtclock_usec() - u->started_at;
+ time_passed = pa_rtclock_now() - u->started_at;
audio_sent = pa_bytes_to_usec(u->write_index, &u->sample_spec);
if (audio_sent <= time_passed) {
@@ -1341,7 +1341,7 @@ static void thread_func(void *userdata) {
int n_written;
if (u->write_index <= 0)
- u->started_at = pa_rtclock_usec();
+ u->started_at = pa_rtclock_now();
if (u->profile == PROFILE_A2DP) {
if ((n_written = a2dp_process_render(u)) < 0)
@@ -1361,7 +1361,7 @@ static void thread_func(void *userdata) {
/* Hmm, there is no input stream we could synchronize
* to. So let's estimate when we need to wake up the latest */
- time_passed = pa_rtclock_usec() - u->started_at;
+ time_passed = pa_rtclock_now() - u->started_at;
next_write_at = pa_bytes_to_usec(u->write_index, &u->sample_spec);
sleep_for = time_passed < next_write_at ? next_write_at - time_passed : 0;
diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index 725faa0c..69dc530b 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -282,7 +282,7 @@ static void thread_func(void *userdata) {
pa_thread_mq_install(&u->thread_mq);
pa_rtpoll_install(u->rtpoll);
- u->thread_info.timestamp = pa_rtclock_usec();
+ u->thread_info.timestamp = pa_rtclock_now();
u->thread_info.in_null_mode = FALSE;
for (;;) {
@@ -296,7 +296,7 @@ static void thread_func(void *userdata) {
if (PA_SINK_IS_OPENED(u->sink->thread_info.state) && !u->thread_info.active_outputs) {
pa_usec_t now;
- now = pa_rtclock_usec();
+ now = pa_rtclock_now();
if (!u->thread_info.in_null_mode || u->thread_info.timestamp <= now)
process_render_null(u, now);
@@ -664,16 +664,16 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
pa_atomic_store(&u->thread_info.running, PA_PTR_TO_UINT(data) == PA_SINK_RUNNING);
if (PA_PTR_TO_UINT(data) == PA_SINK_SUSPENDED)
- pa_smoother_pause(u->thread_info.smoother, pa_rtclock_usec());
+ pa_smoother_pause(u->thread_info.smoother, pa_rtclock_now());
else
- pa_smoother_resume(u->thread_info.smoother, pa_rtclock_usec(), TRUE);
+ pa_smoother_resume(u->thread_info.smoother, pa_rtclock_now(), TRUE);
break;
case PA_SINK_MESSAGE_GET_LATENCY: {
pa_usec_t x, y, c, *delay = data;
- x = pa_rtclock_usec();
+ x = pa_rtclock_now();
y = pa_smoother_get(u->thread_info.smoother, x);
c = pa_bytes_to_usec(u->thread_info.counter, &u->sink->sample_spec);
@@ -730,7 +730,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case SINK_MESSAGE_UPDATE_LATENCY: {
pa_usec_t x, y, latency = (pa_usec_t) offset;
- x = pa_rtclock_usec();
+ x = pa_rtclock_now();
y = pa_bytes_to_usec(u->thread_info.counter, &u->sink->sample_spec);
if (y > latency)
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 8cb25c51..d631da03 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -145,14 +145,14 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case PA_SINK_SUSPENDED:
pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state));
- pa_smoother_pause(u->smoother, pa_rtclock_usec());
+ pa_smoother_pause(u->smoother, pa_rtclock_now());
break;
case PA_SINK_IDLE:
case PA_SINK_RUNNING:
if (u->sink->thread_info.state == PA_SINK_SUSPENDED)
- pa_smoother_resume(u->smoother, pa_rtclock_usec(), TRUE);
+ pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE);
break;
@@ -167,7 +167,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case PA_SINK_MESSAGE_GET_LATENCY: {
pa_usec_t w, r;
- r = pa_smoother_get(u->smoother, pa_rtclock_usec());
+ r = pa_smoother_get(u->smoother, pa_rtclock_now());
w = pa_bytes_to_usec((uint64_t) u->offset + u->memchunk.length, &u->sink->sample_spec);
*((pa_usec_t*) data) = w > r ? w - r : 0;
@@ -202,7 +202,7 @@ static void thread_func(void *userdata) {
pa_thread_mq_install(&u->thread_mq);
pa_rtpoll_install(u->rtpoll);
- pa_smoother_set_time_offset(u->smoother, pa_rtclock_usec());
+ pa_smoother_set_time_offset(u->smoother, pa_rtclock_now());
for (;;) {
int ret;
@@ -295,7 +295,7 @@ static void thread_func(void *userdata) {
else
usec = 0;
- pa_smoother_put(u->smoother, pa_rtclock_usec(), usec);
+ pa_smoother_put(u->smoother, pa_rtclock_now(), usec);
}
/* Hmm, nothing to do. Let's sleep */
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 30a99ca7..8981d52d 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -101,14 +101,14 @@ static int sink_process_msg(
case PA_SINK_MESSAGE_SET_STATE:
if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING)
- u->timestamp = pa_rtclock_usec();
+ u->timestamp = pa_rtclock_now();
break;
case PA_SINK_MESSAGE_GET_LATENCY: {
pa_usec_t now;
- now = pa_rtclock_usec();
+ now = pa_rtclock_now();
*((pa_usec_t*) data) = u->timestamp > now ? u->timestamp - now : 0ULL;
return 0;
@@ -210,7 +210,7 @@ static void thread_func(void *userdata) {
pa_thread_mq_install(&u->thread_mq);
pa_rtpoll_install(u->rtpoll);
- u->timestamp = pa_rtclock_usec();
+ u->timestamp = pa_rtclock_now();
for (;;) {
int ret;
@@ -219,7 +219,7 @@ static void thread_func(void *userdata) {
if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
pa_usec_t now;
- now = pa_rtclock_usec();
+ now = pa_rtclock_now();
if (u->sink->thread_info.rewind_requested) {
if (u->sink->thread_info.rewind_nbytes > 0)
diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c
index 14a04e47..9be4e195 100644
--- a/src/modules/module-sine-source.c
+++ b/src/modules/module-sine-source.c
@@ -101,14 +101,14 @@ static int source_process_msg(
case PA_SOURCE_MESSAGE_SET_STATE:
if (PA_PTR_TO_UINT(data) == PA_SOURCE_RUNNING)
- u->timestamp = pa_rtclock_usec();
+ u->timestamp = pa_rtclock_now();
break;
case PA_SOURCE_MESSAGE_GET_LATENCY: {
pa_usec_t now, left_to_fill;
- now = pa_rtclock_usec();
+ now = pa_rtclock_now();
left_to_fill = u->timestamp > now ? u->timestamp - now : 0ULL;
*((pa_usec_t*) data) = u->block_usec > left_to_fill ? u->block_usec - left_to_fill : 0ULL;
@@ -168,7 +168,7 @@ static void thread_func(void *userdata) {
pa_thread_mq_install(&u->thread_mq);
pa_rtpoll_install(u->rtpoll);
- u->timestamp = pa_rtclock_usec();
+ u->timestamp = pa_rtclock_now();
for (;;) {
int ret;
@@ -176,7 +176,7 @@ static void thread_func(void *userdata) {
if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
pa_usec_t now;
- now = pa_rtclock_usec();
+ now = pa_rtclock_now();
if (u->timestamp <= now)
process_render(u, now);
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 5cfa97a7..08fe6f58 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -641,7 +641,7 @@ static void thread_func(void *userdata) {
* Since we cannot modify the size of the output buffer we fake it
* by not filling it more than u->buffer_size.
*/
- xtime0 = pa_rtclock_usec();
+ xtime0 = pa_rtclock_now();
buffered_bytes = get_playback_buffered_bytes(u);
if (buffered_bytes >= (uint64_t)u->buffer_size)
break;
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index c493d9bb..60498ad7 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -395,7 +395,7 @@ static void check_smoother_status(struct userdata *u, pa_bool_t past) {
pa_assert(u);
- x = pa_rtclock_usec();
+ x = pa_rtclock_now();
/* Correct by the time the requested issued needs to travel to the
* other side. This is a valid thread-safe access, because the
@@ -500,7 +500,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
pa_usec_t yl, yr, *usec = data;
yl = pa_bytes_to_usec((uint64_t) u->counter, &u->sink->sample_spec);
- yr = pa_smoother_get(u->smoother, pa_rtclock_usec());
+ yr = pa_smoother_get(u->smoother, pa_rtclock_now());
*usec = yl > yr ? yl - yr : 0;
return 0;
@@ -533,7 +533,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
else
y = 0;
- pa_smoother_put(u->smoother, pa_rtclock_usec(), y);
+ pa_smoother_put(u->smoother, pa_rtclock_now(), y);
/* We can access this freely here, since the main thread is waiting for us */
u->thread_transport_usec = u->transport_usec;
@@ -607,7 +607,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
pa_usec_t yr, yl, *usec = data;
yl = pa_bytes_to_usec((uint64_t) u->counter, &PA_SOURCE(o)->sample_spec);
- yr = pa_smoother_get(u->smoother, pa_rtclock_usec());
+ yr = pa_smoother_get(u->smoother, pa_rtclock_now());
*usec = yr > yl ? yr - yl : 0;
return 0;
@@ -633,7 +633,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
y = pa_bytes_to_usec((uint64_t) u->counter, &u->source->sample_spec);
y += (pa_usec_t) offset;
- pa_smoother_put(u->smoother, pa_rtclock_usec(), y);
+ pa_smoother_put(u->smoother, pa_rtclock_now(), y);
/* We can access this freely here, since the main thread is waiting for us */
u->thread_transport_usec = u->transport_usec;
@@ -1825,7 +1825,7 @@ int pa__init(pa_module*m) {
TRUE,
TRUE,
10,
- pa_rtclock_usec(),
+ pa_rtclock_now(),
FALSE);
u->ctag = 1;
u->device_index = u->channel = PA_INVALID_INDEX;
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 54de42c2..0e6b9d42 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -181,7 +181,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case PA_SINK_SUSPENDED:
pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state));
- pa_smoother_pause(u->smoother, pa_rtclock_usec());
+ pa_smoother_pause(u->smoother, pa_rtclock_now());
/* Issue a FLUSH if we are connected */
if (u->fd >= 0) {
@@ -193,7 +193,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case PA_SINK_RUNNING:
if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {
- pa_smoother_resume(u->smoother, pa_rtclock_usec(), TRUE);
+ pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE);
/* The connection can be closed when idle, so check to
see if we need to reestablish it */
@@ -216,7 +216,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
case PA_SINK_MESSAGE_GET_LATENCY: {
pa_usec_t w, r;
- r = pa_smoother_get(u->smoother, pa_rtclock_usec());
+ r = pa_smoother_get(u->smoother, pa_rtclock_now());
w = pa_bytes_to_usec((u->offset - u->encoding_overhead + (u->encoded_memchunk.length / u->encoding_ratio)), &u->sink->sample_spec);
*((pa_usec_t*) data) = w > r ? w - r : 0;
@@ -325,7 +325,7 @@ static void thread_func(void *userdata) {
pa_thread_mq_install(&u->thread_mq);
pa_rtpoll_install(u->rtpoll);
- pa_smoother_set_time_offset(u->smoother, pa_rtclock_usec());
+ pa_smoother_set_time_offset(u->smoother, pa_rtclock_now());
/* Create a chunk of memory that is our encoded silence sample. */
pa_memchunk_reset(&silence);
@@ -465,7 +465,7 @@ static void thread_func(void *userdata) {
else
usec = 0;
- pa_smoother_put(u->smoother, pa_rtclock_usec(), usec);
+ pa_smoother_put(u->smoother, pa_rtclock_now(), usec);
}
/* Hmm, nothing to do. Let's sleep */
diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index b86923fb..5a935922 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.c
@@ -193,7 +193,7 @@ static void sink_input_suspend_within_thread(pa_sink_input* i, pa_bool_t b) {
pa_assert_se(s = i->userdata);
if (b) {
- pa_smoother_pause(s->smoother, pa_rtclock_usec());
+ pa_smoother_pause(s->smoother, pa_rtclock_now());
pa_memblockq_flush_read(s->memblockq);
} else
s->first_packet = FALSE;