mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-17 22:05:34 -05:00
database: extract common method to handle machine id and architecture
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/425>
This commit is contained in:
parent
0efae0488c
commit
0ac6b16787
12 changed files with 154 additions and 65 deletions
|
|
@ -618,7 +618,7 @@ static pa_hook_result_t card_preferred_port_changed_callback(pa_core *core, pa_c
|
|||
int pa__init(pa_module*m) {
|
||||
pa_modargs *ma = NULL;
|
||||
struct userdata *u;
|
||||
char *fname;
|
||||
char *state_path;
|
||||
bool restore_bluetooth_profile;
|
||||
|
||||
pa_assert(m);
|
||||
|
|
@ -648,17 +648,15 @@ int pa__init(pa_module*m) {
|
|||
pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_CARD_PROFILE_ADDED], PA_HOOK_NORMAL, (pa_hook_cb_t) card_profile_added_callback, u);
|
||||
pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_PORT_LATENCY_OFFSET_CHANGED], PA_HOOK_NORMAL, (pa_hook_cb_t) port_offset_change_callback, u);
|
||||
|
||||
if (!(fname = pa_state_path("card-database", true)))
|
||||
if (!(state_path = pa_state_path(NULL, true)))
|
||||
goto fail;
|
||||
|
||||
if (!(u->database = pa_database_open(fname, true))) {
|
||||
pa_log("Failed to open volume database '%s': %s", fname, pa_cstrerror(errno));
|
||||
pa_xfree(fname);
|
||||
if (!(u->database = pa_database_open(state_path, "card-database", true, true))) {
|
||||
pa_xfree(state_path);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
pa_log_info("Successfully opened database file '%s'.", fname);
|
||||
pa_xfree(fname);
|
||||
pa_xfree(state_path);
|
||||
|
||||
pa_modargs_free(ma);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue