From: Lennart Poettering Date: Wed, 27 Oct 2004 01:09:51 +0000 (+0000) Subject: two latency interpolation fixes X-Git-Tag: 1.0_branch~4173 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee452b0f06c82dd870de82fb3e6bdd4e14d29f3c;p=profile%2Fivi%2Fpulseaudio.git two latency interpolation fixes git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@257 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index b736daa..cf1a8e6 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -230,9 +230,11 @@ static void pstream_memblock_callback(struct pa_pstream *p, uint32_t channel, ui } int pa_context_handle_error(struct pa_context *c, uint32_t command, struct pa_tagstruct *t) { - assert(c && t); + assert(c); if (command == PA_COMMAND_ERROR) { + assert(t); + if (pa_tagstruct_getu32(t, &c->error) < 0) { pa_context_fail(c, PA_ERROR_PROTOCOL); return -1; diff --git a/polyp/polyplib-stream.c b/polyp/polyplib-stream.c index 68035b0..c8fef67 100644 --- a/polyp/polyplib-stream.c +++ b/polyp/polyplib-stream.c @@ -420,7 +420,7 @@ static void stream_get_latency_info_callback(struct pa_pdispatch *pd, uint32_t c } if (o->stream->interpolate) { - o->stream->ipol_timestamp = now; + o->stream->ipol_timestamp = i.timestamp; o->stream->ipol_usec = pa_stream_get_time(o->stream, &i); } @@ -659,7 +659,7 @@ pa_usec_t pa_stream_get_time(struct pa_stream *s, const struct pa_latency_info * pa_usec_t usec; assert(s); - usec = pa_bytes_to_usec(s->counter, &s->sample_spec); + usec = pa_bytes_to_usec(i->counter, &s->sample_spec); if (i) { if (s->direction == PA_STREAM_PLAYBACK) {