properly parse response to pa_stream_set_buffer_attr() calls. closes #370

This commit is contained in:
Lennart Poettering 2008-10-02 01:15:58 +02:00
parent 54afcf2598
commit 08cf9db0d1

View file

@ -2010,7 +2010,6 @@ static void stream_set_buffer_attr_callback(pa_pdispatch *pd, uint32_t command,
success = 0; success = 0;
} else { } else {
if (o->stream->direction == PA_STREAM_PLAYBACK) { if (o->stream->direction == PA_STREAM_PLAYBACK) {
if (pa_tagstruct_getu32(t, &o->stream->buffer_attr.maxlength) < 0 || if (pa_tagstruct_getu32(t, &o->stream->buffer_attr.maxlength) < 0 ||
pa_tagstruct_getu32(t, &o->stream->buffer_attr.tlength) < 0 || pa_tagstruct_getu32(t, &o->stream->buffer_attr.tlength) < 0 ||
@ -2027,6 +2026,20 @@ static void stream_set_buffer_attr_callback(pa_pdispatch *pd, uint32_t command,
} }
} }
if (o->stream->context->version >= 13) {
pa_usec_t usec;
if (pa_tagstruct_get_usec(t, &usec) < 0) {
pa_context_fail(o->context, PA_ERR_PROTOCOL);
goto finish;
}
if (o->stream->direction == PA_STREAM_RECORD)
o->stream->timing_info.configured_source_usec = usec;
else
o->stream->timing_info.configured_sink_usec = usec;
}
if (!pa_tagstruct_eof(t)) { if (!pa_tagstruct_eof(t)) {
pa_context_fail(o->context, PA_ERR_PROTOCOL); pa_context_fail(o->context, PA_ERR_PROTOCOL);
goto finish; goto finish;