mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -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
				
			
		| 
						 | 
					@ -195,7 +195,7 @@ static bool entry_write(struct userdata *u, const char *name, const struct entry
 | 
				
			||||||
    pa_assert(name);
 | 
					    pa_assert(name);
 | 
				
			||||||
    pa_assert(e);
 | 
					    pa_assert(e);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu8(t, e->version);
 | 
					    pa_tagstruct_putu8(t, e->version);
 | 
				
			||||||
    pa_tagstruct_puts(t, e->profile);
 | 
					    pa_tagstruct_puts(t, e->profile);
 | 
				
			||||||
    pa_tagstruct_putu32(t, pa_hashmap_size(e->ports));
 | 
					    pa_tagstruct_putu32(t, pa_hashmap_size(e->ports));
 | 
				
			||||||
| 
						 | 
					@ -273,7 +273,7 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(data.data, data.size);
 | 
					    t = pa_tagstruct_new_fixed(data.data, data.size);
 | 
				
			||||||
    e = entry_new();
 | 
					    e = entry_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
					    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -207,7 +207,7 @@ static bool entry_write(struct userdata *u, const char *name, const struct entry
 | 
				
			||||||
    pa_assert(name);
 | 
					    pa_assert(name);
 | 
				
			||||||
    pa_assert(e);
 | 
					    pa_assert(e);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu8(t, e->version);
 | 
					    pa_tagstruct_putu8(t, e->version);
 | 
				
			||||||
    pa_tagstruct_puts(t, e->description);
 | 
					    pa_tagstruct_puts(t, e->description);
 | 
				
			||||||
    pa_tagstruct_put_boolean(t, e->user_set_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))
 | 
					    if (!pa_database_get(u->database, &key, &data))
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(data.data, data.size);
 | 
					    t = pa_tagstruct_new_fixed(data.data, data.size);
 | 
				
			||||||
    e = entry_new();
 | 
					    e = entry_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
					    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_IDXSET_FOREACH(c, u->subscribed, idx) {
 | 
				
			||||||
        pa_tagstruct *t;
 | 
					        pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        t = pa_tagstruct_new(NULL, 0);
 | 
					        t = pa_tagstruct_new();
 | 
				
			||||||
        pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
 | 
					        pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
 | 
				
			||||||
        pa_tagstruct_putu32(t, 0);
 | 
					        pa_tagstruct_putu32(t, 0);
 | 
				
			||||||
        pa_tagstruct_putu32(t, u->module->index);
 | 
					        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)
 | 
					  if (pa_tagstruct_getu32(t, &command) < 0)
 | 
				
			||||||
    goto fail;
 | 
					    goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  reply = pa_tagstruct_new(NULL, 0);
 | 
					  reply = pa_tagstruct_new();
 | 
				
			||||||
  pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
					  pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
				
			||||||
  pa_tagstruct_putu32(reply, tag);
 | 
					  pa_tagstruct_putu32(reply, tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -151,7 +151,7 @@ static void trigger_save(struct userdata *u, pa_device_type_t type, uint32_t sin
 | 
				
			||||||
        PA_IDXSET_FOREACH(c, u->subscribed, idx) {
 | 
					        PA_IDXSET_FOREACH(c, u->subscribed, idx) {
 | 
				
			||||||
            pa_tagstruct *t;
 | 
					            pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            t = pa_tagstruct_new(NULL, 0);
 | 
					            t = pa_tagstruct_new();
 | 
				
			||||||
            pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
 | 
					            pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
 | 
				
			||||||
            pa_tagstruct_putu32(t, 0);
 | 
					            pa_tagstruct_putu32(t, 0);
 | 
				
			||||||
            pa_tagstruct_putu32(t, u->module->index);
 | 
					            pa_tagstruct_putu32(t, u->module->index);
 | 
				
			||||||
| 
						 | 
					@ -200,7 +200,7 @@ static bool entry_write(struct userdata *u, const char *name, const struct entry
 | 
				
			||||||
    pa_assert(name);
 | 
					    pa_assert(name);
 | 
				
			||||||
    pa_assert(e);
 | 
					    pa_assert(e);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu8(t, e->version);
 | 
					    pa_tagstruct_putu8(t, e->version);
 | 
				
			||||||
    pa_tagstruct_put_boolean(t, e->port_valid);
 | 
					    pa_tagstruct_put_boolean(t, e->port_valid);
 | 
				
			||||||
    pa_tagstruct_puts(t, e->port);
 | 
					    pa_tagstruct_puts(t, e->port);
 | 
				
			||||||
| 
						 | 
					@ -236,7 +236,7 @@ static struct entry* entry_read(struct userdata *u, const char *name) {
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(data.data, data.size);
 | 
					    t = pa_tagstruct_new_fixed(data.data, data.size);
 | 
				
			||||||
    e = entry_new();
 | 
					    e = entry_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
					    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
				
			||||||
| 
						 | 
					@ -371,7 +371,7 @@ static bool perportentry_write(struct userdata *u, const char *basekeyname, cons
 | 
				
			||||||
    n_formats = pa_idxset_size(e->formats);
 | 
					    n_formats = pa_idxset_size(e->formats);
 | 
				
			||||||
    pa_assert(n_formats > 0);
 | 
					    pa_assert(n_formats > 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu8(t, e->version);
 | 
					    pa_tagstruct_putu8(t, e->version);
 | 
				
			||||||
    pa_tagstruct_put_boolean(t, e->volume_valid);
 | 
					    pa_tagstruct_put_boolean(t, e->volume_valid);
 | 
				
			||||||
    pa_tagstruct_put_channel_map(t, &e->channel_map);
 | 
					    pa_tagstruct_put_channel_map(t, &e->channel_map);
 | 
				
			||||||
| 
						 | 
					@ -417,7 +417,7 @@ static struct perportentry* perportentry_read(struct userdata *u, const char *ba
 | 
				
			||||||
    if (!pa_database_get(u->database, &key, &data))
 | 
					    if (!pa_database_get(u->database, &key, &data))
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(data.data, data.size);
 | 
					    t = pa_tagstruct_new_fixed(data.data, data.size);
 | 
				
			||||||
    e = perportentry_new(false);
 | 
					    e = perportentry_new(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
					    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
				
			||||||
| 
						 | 
					@ -1041,7 +1041,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
 | 
				
			||||||
    if (pa_tagstruct_getu32(t, &command) < 0)
 | 
					    if (pa_tagstruct_getu32(t, &command) < 0)
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reply = pa_tagstruct_new(NULL, 0);
 | 
					    reply = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
					    pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
				
			||||||
    pa_tagstruct_putu32(reply, tag);
 | 
					    pa_tagstruct_putu32(reply, tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -992,7 +992,7 @@ static bool entry_write(struct userdata *u, const char *name, const struct entry
 | 
				
			||||||
    pa_assert(name);
 | 
					    pa_assert(name);
 | 
				
			||||||
    pa_assert(e);
 | 
					    pa_assert(e);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu8(t, e->version);
 | 
					    pa_tagstruct_putu8(t, e->version);
 | 
				
			||||||
    pa_tagstruct_put_boolean(t, e->volume_valid);
 | 
					    pa_tagstruct_put_boolean(t, e->volume_valid);
 | 
				
			||||||
    pa_tagstruct_put_channel_map(t, &e->channel_map);
 | 
					    pa_tagstruct_put_channel_map(t, &e->channel_map);
 | 
				
			||||||
| 
						 | 
					@ -1124,7 +1124,7 @@ static struct entry *entry_read(struct userdata *u, const char *name) {
 | 
				
			||||||
    if (!pa_database_get(u->database, &key, &data))
 | 
					    if (!pa_database_get(u->database, &key, &data))
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(data.data, data.size);
 | 
					    t = pa_tagstruct_new_fixed(data.data, data.size);
 | 
				
			||||||
    e = entry_new();
 | 
					    e = entry_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
					    if (pa_tagstruct_getu8(t, &e->version) < 0 ||
 | 
				
			||||||
| 
						 | 
					@ -1201,7 +1201,7 @@ static void trigger_save(struct userdata *u) {
 | 
				
			||||||
    PA_IDXSET_FOREACH(c, u->subscribed, idx) {
 | 
					    PA_IDXSET_FOREACH(c, u->subscribed, idx) {
 | 
				
			||||||
        pa_tagstruct *t;
 | 
					        pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        t = pa_tagstruct_new(NULL, 0);
 | 
					        t = pa_tagstruct_new();
 | 
				
			||||||
        pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
 | 
					        pa_tagstruct_putu32(t, PA_COMMAND_EXTENSION);
 | 
				
			||||||
        pa_tagstruct_putu32(t, 0);
 | 
					        pa_tagstruct_putu32(t, 0);
 | 
				
			||||||
        pa_tagstruct_putu32(t, u->module->index);
 | 
					        pa_tagstruct_putu32(t, u->module->index);
 | 
				
			||||||
| 
						 | 
					@ -2016,7 +2016,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
 | 
				
			||||||
    if (pa_tagstruct_getu32(t, &command) < 0)
 | 
					    if (pa_tagstruct_getu32(t, &command) < 0)
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reply = pa_tagstruct_new(NULL, 0);
 | 
					    reply = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
					    pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
				
			||||||
    pa_tagstruct_putu32(reply, tag);
 | 
					    pa_tagstruct_putu32(reply, tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -447,7 +447,7 @@ static void stream_cork(struct userdata *u, bool cork) {
 | 
				
			||||||
    if (!u->pstream)
 | 
					    if (!u->pstream)
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
#ifdef TUNNEL_SINK
 | 
					#ifdef TUNNEL_SINK
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_CORK_PLAYBACK_STREAM);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_CORK_PLAYBACK_STREAM);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -880,7 +880,7 @@ static void request_latency(struct userdata *u) {
 | 
				
			||||||
    uint32_t tag;
 | 
					    uint32_t tag;
 | 
				
			||||||
    pa_assert(u);
 | 
					    pa_assert(u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
#ifdef TUNNEL_SINK
 | 
					#ifdef TUNNEL_SINK
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_GET_PLAYBACK_LATENCY);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_GET_PLAYBACK_LATENCY);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -942,7 +942,7 @@ static void update_description(struct userdata *u) {
 | 
				
			||||||
                          pa_get_user_name(un, sizeof(un)),
 | 
					                          pa_get_user_name(un, sizeof(un)),
 | 
				
			||||||
                          pa_get_host_name(hn, sizeof(hn)));
 | 
					                          pa_get_host_name(hn, sizeof(hn)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
#ifdef TUNNEL_SINK
 | 
					#ifdef TUNNEL_SINK
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_SET_PLAYBACK_STREAM_NAME);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_SET_PLAYBACK_STREAM_NAME);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -1362,14 +1362,14 @@ static void request_info(struct userdata *u) {
 | 
				
			||||||
    uint32_t tag;
 | 
					    uint32_t tag;
 | 
				
			||||||
    pa_assert(u);
 | 
					    pa_assert(u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_GET_SERVER_INFO);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_GET_SERVER_INFO);
 | 
				
			||||||
    pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
					    pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
				
			||||||
    pa_pstream_send_tagstruct(u->pstream, t);
 | 
					    pa_pstream_send_tagstruct(u->pstream, t);
 | 
				
			||||||
    pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, server_info_cb, u, NULL);
 | 
					    pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, server_info_cb, u, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef TUNNEL_SINK
 | 
					#ifdef TUNNEL_SINK
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_GET_SINK_INPUT_INFO);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_GET_SINK_INPUT_INFO);
 | 
				
			||||||
    pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
					    pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
				
			||||||
    pa_tagstruct_putu32(t, u->device_index);
 | 
					    pa_tagstruct_putu32(t, u->device_index);
 | 
				
			||||||
| 
						 | 
					@ -1377,7 +1377,7 @@ static void request_info(struct userdata *u) {
 | 
				
			||||||
    pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, sink_input_info_cb, u, NULL);
 | 
					    pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, sink_input_info_cb, u, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->sink_name) {
 | 
					    if (u->sink_name) {
 | 
				
			||||||
        t = pa_tagstruct_new(NULL, 0);
 | 
					        t = pa_tagstruct_new();
 | 
				
			||||||
        pa_tagstruct_putu32(t, PA_COMMAND_GET_SINK_INFO);
 | 
					        pa_tagstruct_putu32(t, PA_COMMAND_GET_SINK_INFO);
 | 
				
			||||||
        pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
					        pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
				
			||||||
        pa_tagstruct_putu32(t, PA_INVALID_INDEX);
 | 
					        pa_tagstruct_putu32(t, PA_INVALID_INDEX);
 | 
				
			||||||
| 
						 | 
					@ -1387,7 +1387,7 @@ static void request_info(struct userdata *u) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    if (u->source_name) {
 | 
					    if (u->source_name) {
 | 
				
			||||||
        t = pa_tagstruct_new(NULL, 0);
 | 
					        t = pa_tagstruct_new();
 | 
				
			||||||
        pa_tagstruct_putu32(t, PA_COMMAND_GET_SOURCE_INFO);
 | 
					        pa_tagstruct_putu32(t, PA_COMMAND_GET_SOURCE_INFO);
 | 
				
			||||||
        pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
					        pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
				
			||||||
        pa_tagstruct_putu32(t, PA_INVALID_INDEX);
 | 
					        pa_tagstruct_putu32(t, PA_INVALID_INDEX);
 | 
				
			||||||
| 
						 | 
					@ -1434,7 +1434,7 @@ static void start_subscribe(struct userdata *u) {
 | 
				
			||||||
    pa_tagstruct *t;
 | 
					    pa_tagstruct *t;
 | 
				
			||||||
    pa_assert(u);
 | 
					    pa_assert(u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_SUBSCRIBE);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_SUBSCRIBE);
 | 
				
			||||||
    pa_tagstruct_putu32(t, u->ctag++);
 | 
					    pa_tagstruct_putu32(t, u->ctag++);
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_SUBSCRIPTION_MASK_SERVER|
 | 
					    pa_tagstruct_putu32(t, PA_SUBSCRIPTION_MASK_SERVER|
 | 
				
			||||||
| 
						 | 
					@ -1619,7 +1619,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
 | 
				
			||||||
                pa_get_host_name(hn, sizeof(hn)));
 | 
					                pa_get_host_name(hn, sizeof(hn)));
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reply = pa_tagstruct_new(NULL, 0);
 | 
					    reply = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(reply, PA_COMMAND_SET_CLIENT_NAME);
 | 
					    pa_tagstruct_putu32(reply, PA_COMMAND_SET_CLIENT_NAME);
 | 
				
			||||||
    pa_tagstruct_putu32(reply, u->ctag++);
 | 
					    pa_tagstruct_putu32(reply, u->ctag++);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1637,7 +1637,7 @@ static void setup_complete_callback(pa_pdispatch *pd, uint32_t command, uint32_t
 | 
				
			||||||
    pa_pstream_send_tagstruct(u->pstream, reply);
 | 
					    pa_pstream_send_tagstruct(u->pstream, reply);
 | 
				
			||||||
    /* We ignore the server's reply here */
 | 
					    /* We ignore the server's reply here */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reply = pa_tagstruct_new(NULL, 0);
 | 
					    reply = pa_tagstruct_new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->version < 13)
 | 
					    if (u->version < 13)
 | 
				
			||||||
        /* Only for older PA versions we need to fill in the maxlength */
 | 
					        /* Only for older PA versions we need to fill in the maxlength */
 | 
				
			||||||
| 
						 | 
					@ -1841,7 +1841,7 @@ static void on_connection(pa_socket_client *sc, pa_iochannel *io, void *userdata
 | 
				
			||||||
    pa_pstream_set_receive_memblock_callback(u->pstream, pstream_memblock_callback, u);
 | 
					    pa_pstream_set_receive_memblock_callback(u->pstream, pstream_memblock_callback, u);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_AUTH);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_AUTH);
 | 
				
			||||||
    pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
					    pa_tagstruct_putu32(t, tag = u->ctag++);
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_PROTOCOL_VERSION);
 | 
					    pa_tagstruct_putu32(t, PA_PROTOCOL_VERSION);
 | 
				
			||||||
| 
						 | 
					@ -1880,7 +1880,7 @@ static void sink_set_volume(pa_sink *sink) {
 | 
				
			||||||
    u = sink->userdata;
 | 
					    u = sink->userdata;
 | 
				
			||||||
    pa_assert(u);
 | 
					    pa_assert(u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_SET_SINK_INPUT_VOLUME);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_SET_SINK_INPUT_VOLUME);
 | 
				
			||||||
    pa_tagstruct_putu32(t, u->ctag++);
 | 
					    pa_tagstruct_putu32(t, u->ctag++);
 | 
				
			||||||
    pa_tagstruct_putu32(t, u->device_index);
 | 
					    pa_tagstruct_putu32(t, u->device_index);
 | 
				
			||||||
| 
						 | 
					@ -1900,7 +1900,7 @@ static void sink_set_mute(pa_sink *sink) {
 | 
				
			||||||
    if (u->version < 11)
 | 
					    if (u->version < 11)
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_SET_SINK_INPUT_MUTE);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_SET_SINK_INPUT_MUTE);
 | 
				
			||||||
    pa_tagstruct_putu32(t, u->ctag++);
 | 
					    pa_tagstruct_putu32(t, u->ctag++);
 | 
				
			||||||
    pa_tagstruct_putu32(t, u->device_index);
 | 
					    pa_tagstruct_putu32(t, u->device_index);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -369,7 +369,7 @@ static void handle_srbchannel_memblock(pa_context *c, pa_memblock *memblock) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Ack the enable command */
 | 
					    /* 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, PA_COMMAND_ENABLE_SRBCHANNEL);
 | 
				
			||||||
    pa_tagstruct_putu32(t, c->srb_setup_tag);
 | 
					    pa_tagstruct_putu32(t, c->srb_setup_tag);
 | 
				
			||||||
    pa_pstream_send_tagstruct(c->pstream, t);
 | 
					    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(c);
 | 
				
			||||||
    pa_assert(tag);
 | 
					    pa_assert(tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, command);
 | 
					    pa_tagstruct_putu32(t, command);
 | 
				
			||||||
    pa_tagstruct_putu32(t, *tag = c->ctag++);
 | 
					    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 */
 | 
					    /* 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, PA_COMMAND_DISABLE_SRBCHANNEL);
 | 
				
			||||||
    pa_tagstruct_putu32(t2, tag);
 | 
					    pa_tagstruct_putu32(t2, tag);
 | 
				
			||||||
    pa_pstream_send_tagstruct(c->pstream, t2);
 | 
					    pa_pstream_send_tagstruct(c->pstream, t2);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -305,7 +305,7 @@ int pa_pdispatch_run(pa_pdispatch *pd, pa_packet *packet, const pa_cmsg_ancil_da
 | 
				
			||||||
    if (packet->length <= 8)
 | 
					    if (packet->length <= 8)
 | 
				
			||||||
        goto finish;
 | 
					        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 ||
 | 
					    if (pa_tagstruct_getu32(ts, &command) < 0 ||
 | 
				
			||||||
        pa_tagstruct_getu32(ts, &tag) < 0)
 | 
					        pa_tagstruct_getu32(ts, &tag) < 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -757,7 +757,7 @@ static void record_stream_send_killed(record_stream *r) {
 | 
				
			||||||
    pa_tagstruct *t;
 | 
					    pa_tagstruct *t;
 | 
				
			||||||
    record_stream_assert_ref(r);
 | 
					    record_stream_assert_ref(r);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_KILLED);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_KILLED);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, r->index);
 | 
					    pa_tagstruct_putu32(t, r->index);
 | 
				
			||||||
| 
						 | 
					@ -818,7 +818,7 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata,
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            t = pa_tagstruct_new(NULL, 0);
 | 
					            t = pa_tagstruct_new();
 | 
				
			||||||
            pa_tagstruct_putu32(t, PA_COMMAND_REQUEST);
 | 
					            pa_tagstruct_putu32(t, PA_COMMAND_REQUEST);
 | 
				
			||||||
            pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					            pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
            pa_tagstruct_putu32(t, s->index);
 | 
					            pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -839,7 +839,7 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata,
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* Report that we're empty */
 | 
					            /* Report that we're empty */
 | 
				
			||||||
            t = pa_tagstruct_new(NULL, 0);
 | 
					            t = pa_tagstruct_new();
 | 
				
			||||||
            pa_tagstruct_putu32(t, PA_COMMAND_UNDERFLOW);
 | 
					            pa_tagstruct_putu32(t, PA_COMMAND_UNDERFLOW);
 | 
				
			||||||
            pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					            pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
            pa_tagstruct_putu32(t, s->index);
 | 
					            pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -853,7 +853,7 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata,
 | 
				
			||||||
            pa_tagstruct *t;
 | 
					            pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* Notify the user we're overflowed*/
 | 
					            /* Notify the user we're overflowed*/
 | 
				
			||||||
            t = pa_tagstruct_new(NULL, 0);
 | 
					            t = pa_tagstruct_new();
 | 
				
			||||||
            pa_tagstruct_putu32(t, PA_COMMAND_OVERFLOW);
 | 
					            pa_tagstruct_putu32(t, PA_COMMAND_OVERFLOW);
 | 
				
			||||||
            pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					            pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
            pa_tagstruct_putu32(t, s->index);
 | 
					            pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -867,7 +867,7 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata,
 | 
				
			||||||
                pa_tagstruct *t;
 | 
					                pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                /* Notify the user we started playback */
 | 
					                /* Notify the user we started playback */
 | 
				
			||||||
                t = pa_tagstruct_new(NULL, 0);
 | 
					                t = pa_tagstruct_new();
 | 
				
			||||||
                pa_tagstruct_putu32(t, PA_COMMAND_STARTED);
 | 
					                pa_tagstruct_putu32(t, PA_COMMAND_STARTED);
 | 
				
			||||||
                pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					                pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
                pa_tagstruct_putu32(t, s->index);
 | 
					                pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -887,7 +887,7 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata,
 | 
				
			||||||
            if (s->connection->version >= 15) {
 | 
					            if (s->connection->version >= 15) {
 | 
				
			||||||
                pa_tagstruct *t;
 | 
					                pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                t = pa_tagstruct_new(NULL, 0);
 | 
					                t = pa_tagstruct_new();
 | 
				
			||||||
                pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED);
 | 
					                pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED);
 | 
				
			||||||
                pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					                pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
                pa_tagstruct_putu32(t, s->index);
 | 
					                pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1285,7 +1285,7 @@ static void playback_stream_send_killed(playback_stream *p) {
 | 
				
			||||||
    pa_tagstruct *t;
 | 
					    pa_tagstruct *t;
 | 
				
			||||||
    playback_stream_assert_ref(p);
 | 
					    playback_stream_assert_ref(p);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_KILLED);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_KILLED);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, p->index);
 | 
					    pa_tagstruct_putu32(t, p->index);
 | 
				
			||||||
| 
						 | 
					@ -1747,7 +1747,7 @@ static void sink_input_send_event_cb(pa_sink_input *i, const char *event, pa_pro
 | 
				
			||||||
    if (s->connection->version < 15)
 | 
					    if (s->connection->version < 15)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_EVENT);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_EVENT);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, s->index);
 | 
					    pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1768,7 +1768,7 @@ static void sink_input_suspend_cb(pa_sink_input *i, bool suspend) {
 | 
				
			||||||
    if (s->connection->version < 12)
 | 
					    if (s->connection->version < 12)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_SUSPENDED);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_SUSPENDED);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, s->index);
 | 
					    pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1795,7 +1795,7 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
 | 
				
			||||||
    if (s->connection->version < 12)
 | 
					    if (s->connection->version < 12)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_MOVED);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_MOVED);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, s->index);
 | 
					    pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1885,7 +1885,7 @@ static void source_output_send_event_cb(pa_source_output *o, const char *event,
 | 
				
			||||||
    if (s->connection->version < 15)
 | 
					    if (s->connection->version < 15)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_EVENT);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_EVENT);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, s->index);
 | 
					    pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1906,7 +1906,7 @@ static void source_output_suspend_cb(pa_source_output *o, bool suspend) {
 | 
				
			||||||
    if (s->connection->version < 12)
 | 
					    if (s->connection->version < 12)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_SUSPENDED);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_SUSPENDED);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, s->index);
 | 
					    pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1934,7 +1934,7 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
 | 
				
			||||||
    if (s->connection->version < 12)
 | 
					    if (s->connection->version < 12)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_MOVED);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_MOVED);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_putu32(t, s->index);
 | 
					    pa_tagstruct_putu32(t, s->index);
 | 
				
			||||||
| 
						 | 
					@ -1975,7 +1975,7 @@ if (!(expression)) { \
 | 
				
			||||||
static pa_tagstruct *reply_new(uint32_t tag) {
 | 
					static pa_tagstruct *reply_new(uint32_t tag) {
 | 
				
			||||||
    pa_tagstruct *reply;
 | 
					    pa_tagstruct *reply;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reply = pa_tagstruct_new(NULL, 0);
 | 
					    reply = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
					    pa_tagstruct_putu32(reply, PA_COMMAND_REPLY);
 | 
				
			||||||
    pa_tagstruct_putu32(reply, tag);
 | 
					    pa_tagstruct_putu32(reply, tag);
 | 
				
			||||||
    return reply;
 | 
					    return reply;
 | 
				
			||||||
| 
						 | 
					@ -2619,7 +2619,7 @@ static void setup_srbchannel(pa_native_connection *c) {
 | 
				
			||||||
    pa_srbchannel_export(srb, &srbt);
 | 
					    pa_srbchannel_export(srb, &srbt);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Send enable command to client */
 | 
					    /* Send enable command to client */
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_ENABLE_SRBCHANNEL);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_ENABLE_SRBCHANNEL);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (size_t) srb); /* tag */
 | 
					    pa_tagstruct_putu32(t, (size_t) srb); /* tag */
 | 
				
			||||||
    fdlist[0] = srbt.readfd;
 | 
					    fdlist[0] = srbt.readfd;
 | 
				
			||||||
| 
						 | 
					@ -3744,7 +3744,7 @@ static void subscription_cb(pa_core *core, pa_subscription_event_type_t e, uint3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_native_connection_assert_ref(c);
 | 
					    pa_native_connection_assert_ref(c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_SUBSCRIBE_EVENT);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_SUBSCRIBE_EVENT);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1);
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1);
 | 
				
			||||||
    pa_tagstruct_putu32(t, e);
 | 
					    pa_tagstruct_putu32(t, e);
 | 
				
			||||||
| 
						 | 
					@ -5037,7 +5037,7 @@ static void client_send_event_cb(pa_client *client, const char*event, pa_proplis
 | 
				
			||||||
    if (c->version < 15)
 | 
					    if (c->version < 15)
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_tagstruct_new(NULL, 0);
 | 
					    t = pa_tagstruct_new();
 | 
				
			||||||
    pa_tagstruct_putu32(t, PA_COMMAND_CLIENT_EVENT);
 | 
					    pa_tagstruct_putu32(t, PA_COMMAND_CLIENT_EVENT);
 | 
				
			||||||
    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
					    pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
 | 
				
			||||||
    pa_tagstruct_puts(t, event);
 | 
					    pa_tagstruct_puts(t, event);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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) {
 | 
					void pa_pstream_send_error(pa_pstream *p, uint32_t tag, uint32_t error) {
 | 
				
			||||||
    pa_tagstruct *t;
 | 
					    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, PA_COMMAND_ERROR);
 | 
				
			||||||
    pa_tagstruct_putu32(t, tag);
 | 
					    pa_tagstruct_putu32(t, tag);
 | 
				
			||||||
    pa_tagstruct_putu32(t, error);
 | 
					    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) {
 | 
					void pa_pstream_send_simple_ack(pa_pstream *p, uint32_t tag) {
 | 
				
			||||||
    pa_tagstruct *t;
 | 
					    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, PA_COMMAND_REPLY);
 | 
				
			||||||
    pa_tagstruct_putu32(t, tag);
 | 
					    pa_tagstruct_putu32(t, tag);
 | 
				
			||||||
    pa_pstream_send_tagstruct(p, t);
 | 
					    pa_pstream_send_tagstruct(p, t);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,16 +48,28 @@ struct pa_tagstruct {
 | 
				
			||||||
    bool dynamic;
 | 
					    bool dynamic;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_tagstruct *pa_tagstruct_new(const uint8_t* data, size_t length) {
 | 
					pa_tagstruct *pa_tagstruct_new(void) {
 | 
				
			||||||
    pa_tagstruct*t;
 | 
					    pa_tagstruct*t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_assert(!data || (data && length));
 | 
					    t = pa_xnew(pa_tagstruct, 1);
 | 
				
			||||||
 | 
					    t->data = NULL;
 | 
				
			||||||
 | 
					    t->allocated = t->length = 0;
 | 
				
			||||||
 | 
					    t->rindex = 0;
 | 
				
			||||||
 | 
					    t->dynamic = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return t;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pa_tagstruct *pa_tagstruct_new_fixed(const uint8_t* data, size_t length) {
 | 
				
			||||||
 | 
					    pa_tagstruct*t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_assert(data && length);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t = pa_xnew(pa_tagstruct, 1);
 | 
					    t = pa_xnew(pa_tagstruct, 1);
 | 
				
			||||||
    t->data = (uint8_t*) data;
 | 
					    t->data = (uint8_t*) data;
 | 
				
			||||||
    t->allocated = t->length = data ? length : 0;
 | 
					    t->allocated = t->length = length;
 | 
				
			||||||
    t->rindex = 0;
 | 
					    t->rindex = 0;
 | 
				
			||||||
    t->dynamic = !data;
 | 
					    t->dynamic = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return t;
 | 
					    return t;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -60,7 +60,8 @@ enum {
 | 
				
			||||||
    PA_TAG_FORMAT_INFO = 'f',
 | 
					    PA_TAG_FORMAT_INFO = 'f',
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_tagstruct *pa_tagstruct_new(const uint8_t* data, size_t length);
 | 
					pa_tagstruct *pa_tagstruct_new(void);
 | 
				
			||||||
 | 
					pa_tagstruct *pa_tagstruct_new_fixed(const uint8_t* data, size_t length);
 | 
				
			||||||
void pa_tagstruct_free(pa_tagstruct*t);
 | 
					void pa_tagstruct_free(pa_tagstruct*t);
 | 
				
			||||||
uint8_t* pa_tagstruct_free_data(pa_tagstruct*t, size_t *l);
 | 
					uint8_t* pa_tagstruct_free_data(pa_tagstruct*t, size_t *l);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue