assert(c->ref >= 1);
pa_context_ref(c);
-
+
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);
-
+
if (s->read_callback) {
size_t l;
PA_CHECK_VALIDITY(s->context, s->peek_memchunk.memblock, PA_ERR_BADSTATE);
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;
}
}
+ 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;
}