core: use pa_{source|sink}_get_latency_within_thread() at one more place

This commit is contained in:
Lennart Poettering 2009-04-14 01:03:10 +02:00
parent 16324fc7be
commit 4ee4a55617
2 changed files with 2 additions and 8 deletions

View file

@ -1362,12 +1362,9 @@ int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t
case PA_SINK_INPUT_MESSAGE_GET_LATENCY: {
pa_usec_t *r = userdata;
pa_usec_t sink_usec = 0;
r[0] += pa_bytes_to_usec(pa_memblockq_get_length(i->thread_info.render_memblockq), &i->sink->sample_spec);
if (i->sink->parent.process_msg(PA_MSGOBJECT(i->sink), PA_SINK_MESSAGE_GET_LATENCY, &sink_usec, 0, NULL) >= 0)
r[1] += sink_usec;
r[1] += pa_sink_get_latency_within_thread(i->sink);
return 0;
}

View file

@ -850,12 +850,9 @@ int pa_source_output_process_msg(pa_msgobject *mo, int code, void *userdata, int
case PA_SOURCE_OUTPUT_MESSAGE_GET_LATENCY: {
pa_usec_t *r = userdata;
pa_usec_t source_usec = 0;
r[0] += pa_bytes_to_usec(pa_memblockq_get_length(o->thread_info.delay_memblockq), &o->source->sample_spec);
if (o->source->parent.process_msg(PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_GET_LATENCY, &source_usec, 0, NULL) >= 0)
r[1] += source_usec;
r[1] += pa_source_get_latency_within_thread(o->source);
return 0;
}