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);
}
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;
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);