mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
correct latency calculation
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@197 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
1231598206
commit
fbefe67d52
4 changed files with 21 additions and 4 deletions
|
|
@ -162,6 +162,7 @@ static void io_callback(struct pa_iochannel *io, void*userdata) {
|
|||
}
|
||||
|
||||
static pa_usec_t sink_get_latency_cb(struct pa_sink *s) {
|
||||
pa_usec_t r = 0;
|
||||
int arg;
|
||||
struct userdata *u = s->userdata;
|
||||
assert(s && u && u->sink);
|
||||
|
|
@ -172,7 +173,12 @@ static pa_usec_t sink_get_latency_cb(struct pa_sink *s) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
return pa_bytes_to_usec(arg, &s->sample_spec);
|
||||
r += pa_bytes_to_usec(arg, &s->sample_spec);
|
||||
|
||||
if (u->memchunk.memblock)
|
||||
r += pa_bytes_to_usec(u->memchunk.length, &s->sample_spec);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int pa__init(struct pa_core *c, struct pa_module*m) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue