mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
fix device reservation for system mode
This commit is contained in:
parent
0329edd179
commit
f3de61edf6
3 changed files with 9 additions and 2 deletions
|
|
@ -164,6 +164,9 @@ static int reserve_init(struct userdata *u, const char *dname) {
|
||||||
if (u->reserve)
|
if (u->reserve)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (pa_in_system_mode())
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* We are resuming, try to lock the device */
|
/* We are resuming, try to lock the device */
|
||||||
if (!(rname = pa_alsa_get_reserve_name(dname)))
|
if (!(rname = pa_alsa_get_reserve_name(dname)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,9 @@ static int reserve_init(struct userdata *u, const char *dname) {
|
||||||
if (u->reserve)
|
if (u->reserve)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (pa_in_system_mode())
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* We are resuming, try to lock the device */
|
/* We are resuming, try to lock the device */
|
||||||
if (!(rname = pa_alsa_get_reserve_name(dname)))
|
if (!(rname = pa_alsa_get_reserve_name(dname)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -310,8 +310,9 @@ int pa__init(pa_module *m) {
|
||||||
|
|
||||||
pa_snprintf(rname, sizeof(rname), "Audio%i", alsa_card_index);
|
pa_snprintf(rname, sizeof(rname), "Audio%i", alsa_card_index);
|
||||||
|
|
||||||
if (!(reserve = pa_reserve_wrapper_get(m->core, rname)))
|
if (!pa_in_system_mode())
|
||||||
goto fail;
|
if (!(reserve = pa_reserve_wrapper_get(m->core, rname)))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
pa_card_new_data_init(&data);
|
pa_card_new_data_init(&data);
|
||||||
data.driver = __FILE__;
|
data.driver = __FILE__;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue