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

@ -84,7 +84,7 @@ void pa_pstream_send_tagstruct_with_fds(pa_pstream *p, pa_tagstruct *t, int nfd,
void pa_pstream_send_error(pa_pstream *p, uint32_t tag, uint32_t error) {
pa_tagstruct *t;
pa_assert_se(t = pa_tagstruct_new(NULL, 0));
pa_assert_se(t = pa_tagstruct_new());
pa_tagstruct_putu32(t, PA_COMMAND_ERROR);
pa_tagstruct_putu32(t, tag);
pa_tagstruct_putu32(t, error);
@ -94,7 +94,7 @@ void pa_pstream_send_error(pa_pstream *p, uint32_t tag, uint32_t error) {
void pa_pstream_send_simple_ack(pa_pstream *p, uint32_t tag) {
pa_tagstruct *t;
pa_assert_se(t = pa_tagstruct_new(NULL, 0));
pa_assert_se(t = pa_tagstruct_new());
pa_tagstruct_putu32(t, PA_COMMAND_REPLY);
pa_tagstruct_putu32(t, tag);
pa_pstream_send_tagstruct(p, t);