mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
always add 'disabled' profile
This commit is contained in:
parent
e0f8c13012
commit
b3a043fd31
1 changed files with 20 additions and 1 deletions
|
|
@ -97,7 +97,6 @@ static void enumerate_cb(
|
|||
t = pa_sprintf_malloc("Output %s", sink->description);
|
||||
} else {
|
||||
pa_assert(source);
|
||||
n = pa_xstrdup(source->name);
|
||||
n = pa_sprintf_malloc("input-%s", source->name);
|
||||
t = pa_sprintf_malloc("Input %s", source->description);
|
||||
}
|
||||
|
|
@ -125,6 +124,18 @@ static void enumerate_cb(
|
|||
pa_hashmap_put(profiles, p->name, p);
|
||||
}
|
||||
|
||||
static void add_disabled_profile(pa_hashmap *profiles) {
|
||||
pa_card_profile *p;
|
||||
struct profile_data *d;
|
||||
|
||||
p = pa_card_profile_new("off", "Off", sizeof(struct profile_data));
|
||||
|
||||
d = PA_CARD_PROFILE_DATA(p);
|
||||
d->sink = d->source = NULL;
|
||||
|
||||
pa_hashmap_put(profiles, p->name, p);
|
||||
}
|
||||
|
||||
int pa__init(pa_module*m) {
|
||||
pa_card_new_data data;
|
||||
pa_modargs *ma;
|
||||
|
|
@ -163,6 +174,14 @@ int pa__init(pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_hashmap_isempty(data.profiles)) {
|
||||
pa_log("Failed to find a working profile.");
|
||||
pa_card_new_data_done(&data);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
add_disabled_profile(data.profiles);
|
||||
|
||||
u->card = pa_card_new(m->core, &data);
|
||||
pa_card_new_data_done(&data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue