mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
kill autoload stuff as planned
This commit is contained in:
parent
43762ed620
commit
29c7a28817
45 changed files with 166 additions and 944 deletions
|
|
@ -103,7 +103,7 @@ static void update_volume(struct userdata *u) {
|
|||
|
||||
u->muted = FALSE;
|
||||
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK, FALSE))) {
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK))) {
|
||||
pa_log_warn("Sink device '%s' not available for unmuting.", pa_strnull(u->sink_name));
|
||||
return;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ static void update_volume(struct userdata *u) {
|
|||
|
||||
u->muted = TRUE;
|
||||
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK, FALSE))) {
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK))) {
|
||||
pa_log_warn("Sink device '%s' not available for muting.", pa_strnull(u->sink_name));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ int pa__init(pa_module*m) {
|
|||
while ((n = pa_split(slaves, ",", &split_state))) {
|
||||
pa_sink *slave_sink;
|
||||
|
||||
if (!(slave_sink = pa_namereg_get(m->core, n, PA_NAMEREG_SINK, TRUE)) || slave_sink == u->sink) {
|
||||
if (!(slave_sink = pa_namereg_get(m->core, n, PA_NAMEREG_SINK)) || slave_sink == u->sink) {
|
||||
pa_log("Invalid slave sink '%s'", n);
|
||||
pa_xfree(n);
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static void load(struct userdata *u) {
|
|||
|
||||
if (!ln[0])
|
||||
pa_log_info("No previous default sink setting, ignoring.");
|
||||
else if (pa_namereg_get(u->core, ln, PA_NAMEREG_SINK, TRUE)) {
|
||||
else if (pa_namereg_get(u->core, ln, PA_NAMEREG_SINK)) {
|
||||
pa_namereg_set_default(u->core, ln, PA_NAMEREG_SINK);
|
||||
pa_log_info("Restored default sink '%s'.", ln);
|
||||
} else
|
||||
|
|
@ -88,7 +88,7 @@ static void load(struct userdata *u) {
|
|||
|
||||
if (!ln[0])
|
||||
pa_log_info("No previous default source setting, ignoring.");
|
||||
else if (pa_namereg_get(u->core, ln, PA_NAMEREG_SOURCE, TRUE)) {
|
||||
else if (pa_namereg_get(u->core, ln, PA_NAMEREG_SOURCE)) {
|
||||
pa_namereg_set_default(u->core, ln, PA_NAMEREG_SOURCE);
|
||||
pa_log_info("Restored default source '%s'.", ln);
|
||||
} else
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ static int hal_device_add_all(struct userdata *u, const char *capability) {
|
|||
pa_log_debug("Not loaded device %s", udis[i]);
|
||||
else {
|
||||
if (d->sink_name)
|
||||
pa_scache_play_item_by_name(u->core, "pulse-coldplug", d->sink_name, FALSE, PA_VOLUME_NORM, NULL, NULL);
|
||||
pa_scache_play_item_by_name(u->core, "pulse-coldplug", d->sink_name, PA_VOLUME_NORM, NULL, NULL);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
@ -418,7 +418,7 @@ static void device_added_time_cb(pa_mainloop_api *ea, pa_time_event *ev, const s
|
|||
pa_log_debug("Not loaded device %s", td->udi);
|
||||
else {
|
||||
if (d->sink_name)
|
||||
pa_scache_play_item_by_name(td->u->core, "pulse-hotplug", d->sink_name, FALSE, PA_VOLUME_NORM, NULL, NULL);
|
||||
pa_scache_play_item_by_name(td->u->core, "pulse-hotplug", d->sink_name, PA_VOLUME_NORM, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -575,13 +575,13 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
|
|||
if (d->sink_name) {
|
||||
pa_sink *sink;
|
||||
|
||||
if ((sink = pa_namereg_get(u->core, d->sink_name, PA_NAMEREG_SINK, 0))) {
|
||||
if ((sink = pa_namereg_get(u->core, d->sink_name, PA_NAMEREG_SINK))) {
|
||||
int prev_suspended = pa_sink_get_state(sink) == PA_SINK_SUSPENDED;
|
||||
|
||||
if (prev_suspended && !suspend) {
|
||||
/* resume */
|
||||
if (pa_sink_suspend(sink, 0) >= 0)
|
||||
pa_scache_play_item_by_name(u->core, "pulse-access", d->sink_name, FALSE, PA_VOLUME_NORM, NULL, NULL);
|
||||
pa_scache_play_item_by_name(u->core, "pulse-access", d->sink_name, PA_VOLUME_NORM, NULL, NULL);
|
||||
else
|
||||
d->acl_race_fix = TRUE;
|
||||
|
||||
|
|
@ -596,7 +596,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
|
|||
if (d->source_name) {
|
||||
pa_source *source;
|
||||
|
||||
if ((source = pa_namereg_get(u->core, d->source_name, PA_NAMEREG_SOURCE, 0))) {
|
||||
if ((source = pa_namereg_get(u->core, d->source_name, PA_NAMEREG_SOURCE))) {
|
||||
int prev_suspended = pa_source_get_state(source) == PA_SOURCE_SUSPENDED;
|
||||
|
||||
if (prev_suspended && !suspend) {
|
||||
|
|
@ -644,14 +644,14 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
|
|||
if (d->sink_name) {
|
||||
pa_sink *sink;
|
||||
|
||||
if ((sink = pa_namereg_get(u->core, d->sink_name, PA_NAMEREG_SINK, 0))) {
|
||||
if ((sink = pa_namereg_get(u->core, d->sink_name, PA_NAMEREG_SINK))) {
|
||||
|
||||
int prev_suspended = pa_sink_get_state(sink) == PA_SINK_SUSPENDED;
|
||||
|
||||
if (prev_suspended) {
|
||||
/* resume */
|
||||
if (pa_sink_suspend(sink, 0) >= 0)
|
||||
pa_scache_play_item_by_name(u->core, "pulse-access", d->sink_name, FALSE, PA_VOLUME_NORM, NULL, NULL);
|
||||
pa_scache_play_item_by_name(u->core, "pulse-access", d->sink_name, PA_VOLUME_NORM, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -659,7 +659,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
|
|||
if (d->source_name) {
|
||||
pa_source *source;
|
||||
|
||||
if ((source = pa_namereg_get(u->core, d->source_name, PA_NAMEREG_SOURCE, 0))) {
|
||||
if ((source = pa_namereg_get(u->core, d->source_name, PA_NAMEREG_SOURCE))) {
|
||||
|
||||
int prev_suspended = pa_source_get_state(source) == PA_SOURCE_SUSPENDED;
|
||||
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!(master = pa_namereg_get(m->core, pa_modargs_get_value(ma, "master", NULL), PA_NAMEREG_SINK, 1))) {
|
||||
if (!(master = pa_namereg_get(m->core, pa_modargs_get_value(ma, "master", NULL), PA_NAMEREG_SINK))) {
|
||||
pa_log("Master sink not found");
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ static void io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io_event
|
|||
else {
|
||||
pa_sink *s;
|
||||
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK, 1)))
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK)))
|
||||
pa_log("Failed to get sink '%s'", u->sink_name);
|
||||
else {
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ static void io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_io_event
|
|||
if (volchange != INVALID) {
|
||||
pa_sink *s;
|
||||
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK, 1)))
|
||||
if (!(s = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK)))
|
||||
pa_log("Failed to get sink '%s'", u->sink_name);
|
||||
else {
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!(master = pa_namereg_get(m->core, pa_modargs_get_value(ma, "master", NULL), PA_NAMEREG_SINK, 1))) {
|
||||
if (!(master = pa_namereg_get(m->core, pa_modargs_get_value(ma, "master", NULL), PA_NAMEREG_SINK))) {
|
||||
pa_log("Master sink not found");
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static pa_hook_result_t sink_hook_callback(pa_core *c, pa_sink *sink, void* user
|
|||
return PA_HOOK_OK;
|
||||
}
|
||||
|
||||
if (!(target = pa_namereg_get(c, NULL, PA_NAMEREG_SINK, 0)) || target == sink) {
|
||||
if (!(target = pa_namereg_get(c, NULL, PA_NAMEREG_SINK)) || target == sink) {
|
||||
uint32_t idx;
|
||||
|
||||
for (target = pa_idxset_first(c->sinks, &idx); target; target = pa_idxset_next(c->sinks, &idx))
|
||||
|
|
@ -97,7 +97,7 @@ static pa_hook_result_t source_hook_callback(pa_core *c, pa_source *source, void
|
|||
return PA_HOOK_OK;
|
||||
}
|
||||
|
||||
if (!(target = pa_namereg_get(c, NULL, PA_NAMEREG_SOURCE, 0)) || target == source) {
|
||||
if (!(target = pa_namereg_get(c, NULL, PA_NAMEREG_SOURCE)) || target == source) {
|
||||
uint32_t idx;
|
||||
|
||||
for (target = pa_idxset_first(c->sources, &idx); target; target = pa_idxset_next(c->sources, &idx))
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!(sink = pa_namereg_get(m->core, pa_modargs_get_value(ma, "sink", NULL), PA_NAMEREG_SINK, TRUE))) {
|
||||
if (!(sink = pa_namereg_get(m->core, pa_modargs_get_value(ma, "sink", NULL), PA_NAMEREG_SINK))) {
|
||||
pa_log("No such sink.");
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n
|
|||
pa_sink *s;
|
||||
|
||||
if (u->restore_device &&
|
||||
(s = pa_namereg_get(c, e->device, PA_NAMEREG_SINK, TRUE))) {
|
||||
(s = pa_namereg_get(c, e->device, PA_NAMEREG_SINK))) {
|
||||
|
||||
if (!new_data->sink) {
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
|
|
@ -371,7 +371,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
|
|||
|
||||
if (u->restore_device &&
|
||||
!new_data->direct_on_input &&
|
||||
(s = pa_namereg_get(c, e->device, PA_NAMEREG_SOURCE, TRUE))) {
|
||||
(s = pa_namereg_get(c, e->device, PA_NAMEREG_SOURCE))) {
|
||||
|
||||
if (!new_data->source) {
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
|
|
@ -442,7 +442,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
|
|||
}
|
||||
|
||||
if (u->restore_device &&
|
||||
(s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE, TRUE))) {
|
||||
(s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE))) {
|
||||
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
pa_sink_input_move_to(si, s);
|
||||
|
|
@ -462,7 +462,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
|
|||
}
|
||||
|
||||
if (u->restore_device &&
|
||||
(s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE, TRUE))) {
|
||||
(s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE))) {
|
||||
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
pa_source_output_move_to(so, s);
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n
|
|||
|
||||
if ((r = pa_hashmap_get(u->hashmap, name))) {
|
||||
if (!data->sink && r->sink) {
|
||||
if ((data->sink = pa_namereg_get(c, r->sink, PA_NAMEREG_SINK, 1)))
|
||||
if ((data->sink = pa_namereg_get(c, r->sink, PA_NAMEREG_SINK)))
|
||||
pa_log_info("Restoring sink for <%s>", r->name);
|
||||
}
|
||||
}
|
||||
|
|
@ -463,7 +463,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
|
|||
|
||||
if ((r = pa_hashmap_get(u->hashmap, name))) {
|
||||
if (!data->source && r->source) {
|
||||
if ((data->source = pa_namereg_get(c, r->source, PA_NAMEREG_SOURCE, 1)))
|
||||
if ((data->source = pa_namereg_get(c, r->source, PA_NAMEREG_SOURCE)))
|
||||
pa_log_info("Restoring source for <%s>", r->name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ static int x11_event_cb(pa_x11_wrapper *w, XEvent *e, void *userdata) {
|
|||
|
||||
bne = (XkbBellNotifyEvent*) e;
|
||||
|
||||
if (pa_scache_play_item_by_name(u->core, u->scache_item, u->sink_name, TRUE, ((pa_volume_t) bne->percent*PA_VOLUME_NORM)/100U, NULL, NULL) < 0) {
|
||||
if (pa_scache_play_item_by_name(u->core, u->scache_item, u->sink_name, ((pa_volume_t) bne->percent*PA_VOLUME_NORM)/100U, NULL, NULL) < 0) {
|
||||
pa_log_info("Ringing bell failed, reverting to X11 device bell.");
|
||||
XkbForceDeviceBell(pa_x11_wrapper_get_display(w), bne->device, bne->bell_class, bne->bell_id, bne->percent);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!(sink = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK, TRUE))) {
|
||||
if (!(sink = pa_namereg_get(u->module->core, u->sink_name, PA_NAMEREG_SINK))) {
|
||||
pa_log("Sink does not exist.");
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (!(s = pa_namereg_get(m->core, pa_modargs_get_value(ma, "source", NULL), PA_NAMEREG_SOURCE, 1))) {
|
||||
if (!(s = pa_namereg_get(m->core, pa_modargs_get_value(ma, "source", NULL), PA_NAMEREG_SOURCE))) {
|
||||
pa_log("Source does not exist.");
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue