static void handle_get_current_volume_type(DBusConnection *conn, DBusMessage *msg, void *userdata) {
pa_stream_manager *m = (pa_stream_manager *)userdata;
const char *direction = NULL;
- const char *type = dbus_str_none;
+ const char *result = dbus_str_none;
void *s = NULL;
stream_type_t stream_type = STREAM_SINK_INPUT;
DBusMessage *reply = NULL;
int cur_max_priority = 0;
const char *cur_max_type = NULL;
const char *role = NULL;
+ const char *type = NULL;
stream_info *s_info;
PA_IDXSET_FOREACH(s, streams, idx) {
}
}
}
- type = cur_max_type;
+
+ if (cur_max_type)
+ result = cur_max_type;
}
- if (!strncmp(type, dbus_str_none, strlen(dbus_str_none)))
+ if (pa_safe_streq(result, dbus_str_none))
ret = RET_MSG_ERROR_NO_STREAM;
finish:
- pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &type,
+ pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &result,
DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[ret],
DBUS_TYPE_INVALID));
pa_assert_se(dbus_connection_send(conn, reply, NULL));