mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
include local record memblockq in latency calculations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@694 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
06bd27b043
commit
7fa8323453
2 changed files with 15 additions and 2 deletions
|
|
@ -297,6 +297,8 @@ static void pstream_memblock_callback(pa_pstream *p, uint32_t channel, int64_t o
|
|||
|
||||
if ((s = pa_dynarray_get(c->record_streams, channel))) {
|
||||
|
||||
assert(seek == PA_SEEK_RELATIVE && offset == 0);
|
||||
|
||||
pa_memblockq_seek(s->record_memblockq, offset, seek);
|
||||
pa_memblockq_push_align(s->record_memblockq, chunk);
|
||||
|
||||
|
|
|
|||
|
|
@ -663,6 +663,10 @@ int pa_stream_drop(pa_stream *s) {
|
|||
|
||||
pa_memblockq_drop(s->record_memblockq, &s->peek_memchunk, s->peek_memchunk.length);
|
||||
|
||||
/* Fix the simulated local read index */
|
||||
if (s->timing_info_valid && !s->timing_info.read_index_corrupt)
|
||||
s->timing_info.read_index += s->peek_memchunk.length;
|
||||
|
||||
pa_memblock_unref(s->peek_memchunk.memblock);
|
||||
s->peek_memchunk.length = 0;
|
||||
s->peek_memchunk.index = 0;
|
||||
|
|
@ -814,6 +818,13 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
}
|
||||
}
|
||||
|
||||
if (o->stream->direction == PA_STREAM_RECORD) {
|
||||
/* Read index correction */
|
||||
|
||||
if (!i->read_index_corrupt)
|
||||
i->read_index -= pa_memblockq_get_length(o->stream->record_memblockq);
|
||||
}
|
||||
|
||||
o->stream->ipol_timestamp = now;
|
||||
o->stream->ipol_usec_valid = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue