mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	modules: Use pa_streq instead of strcmp.
This commit is contained in:
		
							parent
							
								
									e0c16af551
								
							
						
					
					
						commit
						e5954aca8e
					
				
					 19 changed files with 45 additions and 45 deletions
				
			
		| 
						 | 
					@ -2207,22 +2207,22 @@ static int jack_parse_state(
 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!strcmp(rvalue,"yes"))
 | 
					    if (pa_streq(rvalue, "yes"))
 | 
				
			||||||
	pa = PA_PORT_AVAILABLE_YES;
 | 
						pa = PA_PORT_AVAILABLE_YES;
 | 
				
			||||||
    else if (!strcmp(rvalue,"no"))
 | 
					    else if (pa_streq(rvalue, "no"))
 | 
				
			||||||
	pa = PA_PORT_AVAILABLE_NO;
 | 
						pa = PA_PORT_AVAILABLE_NO;
 | 
				
			||||||
    else if (!strcmp(rvalue,"unknown"))
 | 
					    else if (pa_streq(rvalue, "unknown"))
 | 
				
			||||||
	pa = PA_PORT_AVAILABLE_UNKNOWN;
 | 
						pa = PA_PORT_AVAILABLE_UNKNOWN;
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        pa_log("[%s:%u] state must be 'yes','no' or 'unknown' in '%s'", filename, line, section);
 | 
					        pa_log("[%s:%u] state must be 'yes','no' or 'unknown' in '%s'", filename, line, section);
 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!strcmp(lvalue, "state.unplugged"))
 | 
					    if (pa_streq(lvalue, "state.unplugged"))
 | 
				
			||||||
        j->state_unplugged = pa;
 | 
					        j->state_unplugged = pa;
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        j->state_plugged = pa;
 | 
					        j->state_plugged = pa;
 | 
				
			||||||
        pa_assert(!strcmp(lvalue, "state.plugged"));
 | 
					        pa_assert(pa_streq(lvalue, "state.plugged"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
| 
						 | 
					@ -3183,7 +3183,7 @@ static void path_set_condense(pa_alsa_path_set *ps, snd_mixer_t *m) {
 | 
				
			||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                PA_LLIST_FOREACH(jb, p2->jacks) {
 | 
					                PA_LLIST_FOREACH(jb, p2->jacks) {
 | 
				
			||||||
                    if (jb->has_control && !strcmp(jb->alsa_name, ja->alsa_name) &&
 | 
					                    if (jb->has_control && pa_streq(jb->alsa_name, ja->alsa_name) &&
 | 
				
			||||||
                       (ja->state_plugged == jb->state_plugged) &&
 | 
					                       (ja->state_plugged == jb->state_plugged) &&
 | 
				
			||||||
                       (ja->state_unplugged == jb->state_unplugged)) {
 | 
					                       (ja->state_unplugged == jb->state_unplugged)) {
 | 
				
			||||||
                        exists = TRUE;
 | 
					                        exists = TRUE;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -228,7 +228,7 @@ static struct bonding* bonding_new(struct userdata *u, const char *a) {
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (strcmp(class, "phone")) {
 | 
					    if (!pa_streq(class, "phone")) {
 | 
				
			||||||
        pa_log_info("Found device '%s' of class '%s', ignoring.", a, class);
 | 
					        pa_log_info("Found device '%s' of class '%s', ignoring.", a, class);
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -491,13 +491,13 @@ static int get_access_arg(pa_modargs *ma, pa_bool_t *local_access, pa_bool_t *re
 | 
				
			||||||
    if (!(value = pa_modargs_get_value(ma, "access", NULL)))
 | 
					    if (!(value = pa_modargs_get_value(ma, "access", NULL)))
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!strcmp(value, "local")) {
 | 
					    if (pa_streq(value, "local")) {
 | 
				
			||||||
        *local_access = TRUE;
 | 
					        *local_access = TRUE;
 | 
				
			||||||
        *remote_access = FALSE;
 | 
					        *remote_access = FALSE;
 | 
				
			||||||
    } else if (!strcmp(value, "remote")) {
 | 
					    } else if (pa_streq(value, "remote")) {
 | 
				
			||||||
        *local_access = FALSE;
 | 
					        *local_access = FALSE;
 | 
				
			||||||
        *remote_access = TRUE;
 | 
					        *remote_access = TRUE;
 | 
				
			||||||
    } else if (!strcmp(value, "local,remote")) {
 | 
					    } else if (pa_streq(value, "local,remote")) {
 | 
				
			||||||
        *local_access = TRUE;
 | 
					        *local_access = TRUE;
 | 
				
			||||||
        *remote_access = TRUE;
 | 
					        *remote_access = TRUE;
 | 
				
			||||||
    } else
 | 
					    } else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -173,8 +173,8 @@ static void load_module(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!is_new) {
 | 
					    if (!is_new) {
 | 
				
			||||||
        if (m->items[i].index != PA_INVALID_INDEX &&
 | 
					        if (m->items[i].index != PA_INVALID_INDEX &&
 | 
				
			||||||
            strcmp(m->items[i].name, name) == 0 &&
 | 
					            pa_streq(m->items[i].name, name) &&
 | 
				
			||||||
            strcmp(m->items[i].args, args) == 0)
 | 
					            pa_streq(m->items[i].args, args))
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        unload_one_module(u, m, i);
 | 
					        unload_one_module(u, m, i);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -186,7 +186,7 @@ static DBusHandlerResult dbus_filter_handler(DBusConnection *c, DBusMessage *s,
 | 
				
			||||||
                                   DBUS_TYPE_STRING, &new,
 | 
					                                   DBUS_TYPE_STRING, &new,
 | 
				
			||||||
                                   DBUS_TYPE_INVALID))
 | 
					                                   DBUS_TYPE_INVALID))
 | 
				
			||||||
            goto finish;
 | 
					            goto finish;
 | 
				
			||||||
        if (strcmp(name, JACK_SERVICE_NAME))
 | 
					        if (!pa_streq(name, JACK_SERVICE_NAME))
 | 
				
			||||||
            goto finish;
 | 
					            goto finish;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ensure_ports_stopped(u);
 | 
					        ensure_ports_stopped(u);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,7 @@ static int ca_device_added(struct pa_module *m, AudioObjectID id) {
 | 
				
			||||||
    size = sizeof(tmp);
 | 
					    size = sizeof(tmp);
 | 
				
			||||||
    err = AudioObjectGetPropertyData(id, &property_address, 0, NULL, &size, tmp);
 | 
					    err = AudioObjectGetPropertyData(id, &property_address, 0, NULL, &size, tmp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!err && strcmp(tmp, "pulseaudio.org") == 0)
 | 
					    if (!err && pa_streq(tmp, "pulseaudio.org"))
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->ioproc_frames)
 | 
					    if (u->ioproc_frames)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -183,8 +183,8 @@ static void update_rule(struct rule *r) {
 | 
				
			||||||
        if ((desktopfiles_dir = opendir(DESKTOPFILEDIR))) {
 | 
					        if ((desktopfiles_dir = opendir(DESKTOPFILEDIR))) {
 | 
				
			||||||
            while ((dir = readdir(desktopfiles_dir))) {
 | 
					            while ((dir = readdir(desktopfiles_dir))) {
 | 
				
			||||||
                if (dir->d_type != DT_DIR
 | 
					                if (dir->d_type != DT_DIR
 | 
				
			||||||
                    || strcmp(dir->d_name, ".") == 0
 | 
					                    || pa_streq(dir->d_name, ".")
 | 
				
			||||||
                    || strcmp(dir->d_name, "..") == 0)
 | 
					                    || pa_streq(dir->d_name, ".."))
 | 
				
			||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                pa_xfree(fn);
 | 
					                pa_xfree(fn);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -142,7 +142,7 @@ static int detect_oss(pa_core *c, int just_one) {
 | 
				
			||||||
        line[strcspn(line, "\r\n")] = 0;
 | 
					        line[strcspn(line, "\r\n")] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!b) {
 | 
					        if (!b) {
 | 
				
			||||||
            b = strcmp(line, "Audio devices:") == 0 || strcmp(line, "Installed devices:") == 0;
 | 
					            b = pa_streq(line, "Audio devices:") || pa_streq(line, "Installed devices:");
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -537,7 +537,7 @@ static uint32_t get_role_index(const char* role) {
 | 
				
			||||||
    pa_assert(role);
 | 
					    pa_assert(role);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (uint32_t i = ROLE_NONE; i < NUM_ROLES; ++i)
 | 
					    for (uint32_t i = ROLE_NONE; i < NUM_ROLES; ++i)
 | 
				
			||||||
        if (strcmp(role, role_names[i]) == 0)
 | 
					        if (pa_streq(role, role_names[i]))
 | 
				
			||||||
            return i;
 | 
					            return i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return PA_INVALID_INDEX;
 | 
					    return PA_INVALID_INDEX;
 | 
				
			||||||
| 
						 | 
					@ -551,7 +551,7 @@ static void update_highest_priority_device_indexes(struct userdata *u, const cha
 | 
				
			||||||
    pa_assert(u);
 | 
					    pa_assert(u);
 | 
				
			||||||
    pa_assert(prefix);
 | 
					    pa_assert(prefix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sink_mode = (strcmp(prefix, "sink:") == 0);
 | 
					    sink_mode = pa_streq(prefix, "sink:");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (sink_mode)
 | 
					    if (sink_mode)
 | 
				
			||||||
        indexes = &u->preferred_sinks;
 | 
					        indexes = &u->preferred_sinks;
 | 
				
			||||||
| 
						 | 
					@ -592,7 +592,7 @@ static void update_highest_priority_device_indexes(struct userdata *u, const cha
 | 
				
			||||||
                            PA_IDXSET_FOREACH(sink, u->core->sinks, idx) {
 | 
					                            PA_IDXSET_FOREACH(sink, u->core->sinks, idx) {
 | 
				
			||||||
                                if ((pa_sink*) ignore_device == sink)
 | 
					                                if ((pa_sink*) ignore_device == sink)
 | 
				
			||||||
                                    continue;
 | 
					                                    continue;
 | 
				
			||||||
                                if (strcmp(sink->name, device_name) == 0) {
 | 
					                                if (pa_streq(sink->name, device_name)) {
 | 
				
			||||||
                                    found = TRUE;
 | 
					                                    found = TRUE;
 | 
				
			||||||
                                    idx = sink->index; /* Is this needed? */
 | 
					                                    idx = sink->index; /* Is this needed? */
 | 
				
			||||||
                                    break;
 | 
					                                    break;
 | 
				
			||||||
| 
						 | 
					@ -604,7 +604,7 @@ static void update_highest_priority_device_indexes(struct userdata *u, const cha
 | 
				
			||||||
                            PA_IDXSET_FOREACH(source, u->core->sources, idx) {
 | 
					                            PA_IDXSET_FOREACH(source, u->core->sources, idx) {
 | 
				
			||||||
                                if ((pa_source*) ignore_device == source)
 | 
					                                if ((pa_source*) ignore_device == source)
 | 
				
			||||||
                                    continue;
 | 
					                                    continue;
 | 
				
			||||||
                                if (strcmp(source->name, device_name) == 0) {
 | 
					                                if (pa_streq(source->name, device_name)) {
 | 
				
			||||||
                                    found = TRUE;
 | 
					                                    found = TRUE;
 | 
				
			||||||
                                    idx = source->index; /* Is this needed? */
 | 
					                                    idx = source->index; /* Is this needed? */
 | 
				
			||||||
                                    break;
 | 
					                                    break;
 | 
				
			||||||
| 
						 | 
					@ -1159,7 +1159,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
 | 
				
			||||||
            if ((device_name = get_name(name, "sink:"))) {
 | 
					            if ((device_name = get_name(name, "sink:"))) {
 | 
				
			||||||
                pa_sink* s;
 | 
					                pa_sink* s;
 | 
				
			||||||
                PA_IDXSET_FOREACH(s, u->core->sinks, idx) {
 | 
					                PA_IDXSET_FOREACH(s, u->core->sinks, idx) {
 | 
				
			||||||
                    if (strcmp(s->name, device_name) == 0) {
 | 
					                    if (pa_streq(s->name, device_name)) {
 | 
				
			||||||
                        found_index = s->index;
 | 
					                        found_index = s->index;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -1168,7 +1168,7 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
 | 
				
			||||||
            } else if ((device_name = get_name(name, "source:"))) {
 | 
					            } else if ((device_name = get_name(name, "source:"))) {
 | 
				
			||||||
                pa_source* s;
 | 
					                pa_source* s;
 | 
				
			||||||
                PA_IDXSET_FOREACH(s, u->core->sources, idx) {
 | 
					                PA_IDXSET_FOREACH(s, u->core->sources, idx) {
 | 
				
			||||||
                    if (strcmp(s->name, device_name) == 0) {
 | 
					                    if (pa_streq(s->name, device_name)) {
 | 
				
			||||||
                        found_index = s->index;
 | 
					                        found_index = s->index;
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -562,7 +562,7 @@ int pa__init(pa_module*m) {
 | 
				
			||||||
            goto fail;
 | 
					            goto fail;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (strcmp(d->Label, label) == 0)
 | 
					        if (pa_streq(d->Label, label))
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -627,7 +627,7 @@ int pa__init(pa_module*m) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for (p = 0; p < d->PortCount; p++) {
 | 
					            for (p = 0; p < d->PortCount; p++) {
 | 
				
			||||||
                if (strcmp(d->PortNames[p], pname) == 0) {
 | 
					                if (pa_streq(d->PortNames[p], pname)) {
 | 
				
			||||||
                    if (LADSPA_IS_PORT_AUDIO(d->PortDescriptors[p]) && LADSPA_IS_PORT_INPUT(d->PortDescriptors[p])) {
 | 
					                    if (LADSPA_IS_PORT_AUDIO(d->PortDescriptors[p]) && LADSPA_IS_PORT_INPUT(d->PortDescriptors[p])) {
 | 
				
			||||||
                        input_ladspaport[c] = p;
 | 
					                        input_ladspaport[c] = p;
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
| 
						 | 
					@ -653,7 +653,7 @@ int pa__init(pa_module*m) {
 | 
				
			||||||
                goto fail;
 | 
					                goto fail;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            for (p = 0; p < d->PortCount; p++) {
 | 
					            for (p = 0; p < d->PortCount; p++) {
 | 
				
			||||||
                if (strcmp(d->PortNames[p], pname) == 0) {
 | 
					                if (pa_streq(d->PortNames[p], pname)) {
 | 
				
			||||||
                    if (LADSPA_IS_PORT_AUDIO(d->PortDescriptors[p]) && LADSPA_IS_PORT_OUTPUT(d->PortDescriptors[p])) {
 | 
					                    if (LADSPA_IS_PORT_AUDIO(d->PortDescriptors[p]) && LADSPA_IS_PORT_OUTPUT(d->PortDescriptors[p])) {
 | 
				
			||||||
                        output_ladspaport[c] = p;
 | 
					                        output_ladspaport[c] = p;
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1136,7 +1136,7 @@ static void sink_info_cb(pa_pdispatch *pd, uint32_t command,  uint32_t tag, pa_t
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_proplist_free(pl);
 | 
					    pa_proplist_free(pl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!u->sink_name || strcmp(name, u->sink_name))
 | 
					    if (!u->sink_name || !pa_streq(name, u->sink_name))
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_xfree(u->device_description);
 | 
					    pa_xfree(u->device_description);
 | 
				
			||||||
| 
						 | 
					@ -1347,7 +1347,7 @@ static void source_info_cb(pa_pdispatch *pd, uint32_t command,  uint32_t tag, pa
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_proplist_free(pl);
 | 
					    pa_proplist_free(pl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!u->source_name || strcmp(name, u->source_name))
 | 
					    if (!u->source_name || !pa_streq(name, u->source_name))
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_xfree(u->device_description);
 | 
					    pa_xfree(u->device_description);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -163,17 +163,17 @@ static void resolver_cb(
 | 
				
			||||||
            char *key, *value;
 | 
					            char *key, *value;
 | 
				
			||||||
            pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0);
 | 
					            pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (strcmp(key, "device") == 0) {
 | 
					            if (pa_streq(key, "device")) {
 | 
				
			||||||
                pa_xfree(device);
 | 
					                pa_xfree(device);
 | 
				
			||||||
                device = value;
 | 
					                device = value;
 | 
				
			||||||
                value = NULL;
 | 
					                value = NULL;
 | 
				
			||||||
            } else if (strcmp(key, "rate") == 0)
 | 
					            } else if (pa_streq(key, "rate"))
 | 
				
			||||||
                ss.rate = (uint32_t) atoi(value);
 | 
					                ss.rate = (uint32_t) atoi(value);
 | 
				
			||||||
            else if (strcmp(key, "channels") == 0)
 | 
					            else if (pa_streq(key, "channels"))
 | 
				
			||||||
                ss.channels = (uint8_t) atoi(value);
 | 
					                ss.channels = (uint8_t) atoi(value);
 | 
				
			||||||
            else if (strcmp(key, "format") == 0)
 | 
					            else if (pa_streq(key, "format"))
 | 
				
			||||||
                ss.format = pa_parse_sample_format(value);
 | 
					                ss.format = pa_parse_sample_format(value);
 | 
				
			||||||
            else if (strcmp(key, "channel_map") == 0) {
 | 
					            else if (pa_streq(key, "channel_map")) {
 | 
				
			||||||
                pa_channel_map_parse(&cm, value);
 | 
					                pa_channel_map_parse(&cm, value);
 | 
				
			||||||
                channel_map_set = TRUE;
 | 
					                channel_map_set = TRUE;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -359,7 +359,7 @@ int pa_oss_get_hw_description(const char *dev, char *name, size_t l) {
 | 
				
			||||||
        line[strcspn(line, "\r\n")] = 0;
 | 
					        line[strcspn(line, "\r\n")] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!b) {
 | 
					        if (!b) {
 | 
				
			||||||
            b = strcmp(line, "Audio devices:") == 0;
 | 
					            b = pa_streq(line, "Audio devices:");
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -166,7 +166,7 @@ static void resolver_cb(
 | 
				
			||||||
            pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0);
 | 
					            pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            pa_log_debug("Found key: '%s' with value: '%s'", key, value);
 | 
					            pa_log_debug("Found key: '%s' with value: '%s'", key, value);
 | 
				
			||||||
            if (strcmp(key, "device") == 0) {
 | 
					            if (pa_streq(key, "device")) {
 | 
				
			||||||
                pa_xfree(device);
 | 
					                pa_xfree(device);
 | 
				
			||||||
                device = value;
 | 
					                device = value;
 | 
				
			||||||
                value = NULL;
 | 
					                value = NULL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -303,11 +303,11 @@ static void rtsp_cb(pa_rtsp_client *rtsp, pa_rtsp_state state, pa_headerlist* he
 | 
				
			||||||
                while ((token = pa_split(aj, delimiters, &token_state))) {
 | 
					                while ((token = pa_split(aj, delimiters, &token_state))) {
 | 
				
			||||||
                    if ((pc = strstr(token, "="))) {
 | 
					                    if ((pc = strstr(token, "="))) {
 | 
				
			||||||
                      *pc = 0;
 | 
					                      *pc = 0;
 | 
				
			||||||
                      if (!strcmp(token, "type") && !strcmp(pc+1, "digital")) {
 | 
					                      if (pa_streq(token, "type") && pa_streq(pc+1, "digital")) {
 | 
				
			||||||
                          c->jack_type = JACK_TYPE_DIGITAL;
 | 
					                          c->jack_type = JACK_TYPE_DIGITAL;
 | 
				
			||||||
                      }
 | 
					                      }
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                        if (!strcmp(token,"connected"))
 | 
					                        if (pa_streq(token, "connected"))
 | 
				
			||||||
                            c->jack_status = JACK_STATUS_CONNECTED;
 | 
					                            c->jack_status = JACK_STATUS_CONNECTED;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    pa_xfree(token);
 | 
					                    pa_xfree(token);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -398,13 +398,13 @@ const char* pa_rtp_format_to_string(pa_sample_format_t f) {
 | 
				
			||||||
pa_sample_format_t pa_rtp_string_to_format(const char *s) {
 | 
					pa_sample_format_t pa_rtp_string_to_format(const char *s) {
 | 
				
			||||||
    pa_assert(s);
 | 
					    pa_assert(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!(strcmp(s, "L16")))
 | 
					    if (pa_streq(s, "L16"))
 | 
				
			||||||
        return PA_SAMPLE_S16BE;
 | 
					        return PA_SAMPLE_S16BE;
 | 
				
			||||||
    else if (!strcmp(s, "L8"))
 | 
					    else if (pa_streq(s, "L8"))
 | 
				
			||||||
        return PA_SAMPLE_U8;
 | 
					        return PA_SAMPLE_U8;
 | 
				
			||||||
    else if (!strcmp(s, "PCMA"))
 | 
					    else if (pa_streq(s, "PCMA"))
 | 
				
			||||||
        return PA_SAMPLE_ALAW;
 | 
					        return PA_SAMPLE_ALAW;
 | 
				
			||||||
    else if (!strcmp(s, "PCMU"))
 | 
					    else if (pa_streq(s, "PCMU"))
 | 
				
			||||||
        return PA_SAMPLE_ULAW;
 | 
					        return PA_SAMPLE_ULAW;
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        return PA_SAMPLE_INVALID;
 | 
					        return PA_SAMPLE_INVALID;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -187,7 +187,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
 | 
				
			||||||
        *s2p = '\0';
 | 
					        *s2p = '\0';
 | 
				
			||||||
        s2p -= 1;
 | 
					        s2p -= 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (c->waiting && 0 == strcmp("RTSP/1.0 200 OK", s2)) {
 | 
					    if (c->waiting && pa_streq(s2, "RTSP/1.0 200 OK")) {
 | 
				
			||||||
        c->waiting = 0;
 | 
					        c->waiting = 0;
 | 
				
			||||||
        if (c->response_headers)
 | 
					        if (c->response_headers)
 | 
				
			||||||
            pa_headerlist_free(c->response_headers);
 | 
					            pa_headerlist_free(c->response_headers);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -212,7 +212,7 @@ int pa_sap_recv(pa_sap_context *c, pa_bool_t *goodbye) {
 | 
				
			||||||
    e = buf + k;
 | 
					    e = buf + k;
 | 
				
			||||||
    size -= (int) k;
 | 
					    size -= (int) k;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((unsigned) size >= sizeof(MIME_TYPE) && !strcmp(e, MIME_TYPE)) {
 | 
					    if ((unsigned) size >= sizeof(MIME_TYPE) && pa_streq(e, MIME_TYPE)) {
 | 
				
			||||||
        e += sizeof(MIME_TYPE);
 | 
					        e += sizeof(MIME_TYPE);
 | 
				
			||||||
        size -= (int) sizeof(MIME_TYPE);
 | 
					        size -= (int) sizeof(MIME_TYPE);
 | 
				
			||||||
    } else if ((unsigned) size < sizeof(PA_SDP_HEADER)-1 || strncmp(e, PA_SDP_HEADER, sizeof(PA_SDP_HEADER)-1)) {
 | 
					    } else if ((unsigned) size < sizeof(PA_SDP_HEADER)-1 || strncmp(e, PA_SDP_HEADER, sizeof(PA_SDP_HEADER)-1)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -103,7 +103,7 @@ static pa_hook_result_t servers_changed_cb(void *hook_data, void *call_data, voi
 | 
				
			||||||
    pa_assert(u);
 | 
					    pa_assert(u);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    screen = DefaultScreen(pa_x11_wrapper_get_display(u->x11_wrapper));
 | 
					    screen = DefaultScreen(pa_x11_wrapper_get_display(u->x11_wrapper));
 | 
				
			||||||
    if (!pa_x11_get_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_ID", t, sizeof(t)) || strcmp(t, u->id)) {
 | 
					    if (!pa_x11_get_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_ID", t, sizeof(t)) || !pa_streq(t, u->id)) {
 | 
				
			||||||
        pa_log_warn("PulseAudio information vanished from X11!");
 | 
					        pa_log_warn("PulseAudio information vanished from X11!");
 | 
				
			||||||
        return PA_HOOK_OK;
 | 
					        return PA_HOOK_OK;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -217,7 +217,7 @@ void pa__done(pa_module*m) {
 | 
				
			||||||
        int screen = DefaultScreen(pa_x11_wrapper_get_display(u->x11_wrapper));
 | 
					        int screen = DefaultScreen(pa_x11_wrapper_get_display(u->x11_wrapper));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* Yes, here is a race condition */
 | 
					        /* Yes, here is a race condition */
 | 
				
			||||||
        if (!pa_x11_get_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_ID", t, sizeof(t)) || strcmp(t, u->id))
 | 
					        if (!pa_x11_get_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_ID", t, sizeof(t)) || !pa_streq(t, u->id))
 | 
				
			||||||
            pa_log_warn("PulseAudio information vanished from X11!");
 | 
					            pa_log_warn("PulseAudio information vanished from X11!");
 | 
				
			||||||
        else {
 | 
					        else {
 | 
				
			||||||
            pa_x11_del_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_ID");
 | 
					            pa_x11_del_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_ID");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue