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

@ -369,7 +369,7 @@ static void handle_srbchannel_memblock(pa_context *c, pa_memblock *memblock) {
}
/* Ack the enable command */
t = pa_tagstruct_new(NULL, 0);
t = pa_tagstruct_new();
pa_tagstruct_putu32(t, PA_COMMAND_ENABLE_SRBCHANNEL);
pa_tagstruct_putu32(t, c->srb_setup_tag);
pa_pstream_send_tagstruct(c->pstream, t);
@ -1305,7 +1305,7 @@ pa_tagstruct *pa_tagstruct_command(pa_context *c, uint32_t command, uint32_t *ta
pa_assert(c);
pa_assert(tag);
t = pa_tagstruct_new(NULL, 0);
t = pa_tagstruct_new();
pa_tagstruct_putu32(t, command);
pa_tagstruct_putu32(t, *tag = c->ctag++);
@ -1479,7 +1479,7 @@ static void pa_command_disable_srbchannel(pa_pdispatch *pd, uint32_t command, ui
}
/* Send disable command back again */
t2 = pa_tagstruct_new(NULL, 0);
t2 = pa_tagstruct_new();
pa_tagstruct_putu32(t2, PA_COMMAND_DISABLE_SRBCHANNEL);
pa_tagstruct_putu32(t2, tag);
pa_pstream_send_tagstruct(c->pstream, t2);