mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
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:
parent
7c223a6565
commit
037fdf485f
11 changed files with 70 additions and 57 deletions
|
|
@ -207,7 +207,7 @@ static bool entry_write(struct userdata *u, const char *name, const struct entry
|
|||
pa_assert(name);
|
||||
pa_assert(e);
|
||||
|
||||
t = pa_tagstruct_new(NULL, 0);
|
||||
t = pa_tagstruct_new();
|
||||
pa_tagstruct_putu8(t, e->version);
|
||||
pa_tagstruct_puts(t, e->description);
|
||||
pa_tagstruct_put_boolean(t, e->user_set_description);
|
||||
|
|
@ -295,7 +295,7 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
|
|||
if (!pa_database_get(u->database, &key, &data))
|
||||
goto fail;
|
||||
|
||||
t = pa_tagstruct_new(data.data, data.size);
|
||||
t = pa_tagstruct_new_fixed(data.data, data.size);
|
||||
e = entry_new();
|
||||
|
||||
if (pa_tagstruct_getu8(t, &e->version) < 0 ||
|
||||
|
|
@ -449,7 +449,7 @@ static void notify_subscribers(struct userdata *u) {
|
|||
PA_IDXSET_FOREACH(c, u->subscribed, idx) {
|
||||
pa_tagstruct *t;
|
||||
|
||||
t = pa_tagstruct_new(NULL, 0);
|
||||
t = pa_tagstruct_new();
|
||||
pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
|
||||
pa_tagstruct_putu32(t, 0);
|
||||
pa_tagstruct_putu32(t, u->module->index);
|
||||
|
|
@ -1130,7 +1130,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
|
|||
if (pa_tagstruct_getu32(t, &command) < 0)
|
||||
goto fail;
|
||||
|
||||
reply = pa_tagstruct_new(NULL, 0);
|
||||
reply = pa_tagstruct_new();
|
||||
pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
|
||||
pa_tagstruct_putu32(reply, tag);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue