tagstruct: Distinguish pa_tagstruct_new() use cases

pa_tagstruct_new() is called either with no data, i.e. (NULL, 0)
to create a dynamic tagstruct or with a pointer to fixed data

introduce a new function pa_tagstruct_new_fixed() for the latter case

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2014-10-23 16:09:45 +02:00 committed by Peter Meerwald
parent 7c223a6565
commit 037fdf485f
11 changed files with 70 additions and 57 deletions

View file

@ -305,7 +305,7 @@ int pa_pdispatch_run(pa_pdispatch *pd, pa_packet *packet, const pa_cmsg_ancil_da
if (packet->length <= 8)
goto finish;
ts = pa_tagstruct_new(packet->data, packet->length);
ts = pa_tagstruct_new_fixed(packet->data, packet->length);
if (pa_tagstruct_getu32(ts, &command) < 0 ||
pa_tagstruct_getu32(ts, &tag) < 0)