mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-07 21:03:00 -05:00
[pulseaudio] allow specification of pulseaudio server
This commit is contained in:
@@ -104,6 +104,7 @@ static cfg_opt_t sec_audio[] =
|
||||
{
|
||||
CFG_STR("nickname", "Computer", CFGF_NONE),
|
||||
CFG_STR("type", NULL, CFGF_NONE),
|
||||
CFG_STR("server", NULL, CFGF_NONE),
|
||||
CFG_STR("card", "default", CFGF_NONE),
|
||||
CFG_STR("mixer", NULL, CFGF_NONE),
|
||||
CFG_STR("mixer_device", NULL, CFGF_NONE),
|
||||
|
||||
@@ -891,6 +891,7 @@ static int
|
||||
pulse_init(void)
|
||||
{
|
||||
char *type;
|
||||
char *server;
|
||||
int state;
|
||||
int ret;
|
||||
|
||||
@@ -898,6 +899,8 @@ pulse_init(void)
|
||||
if (type && (strcasecmp(type, "pulseaudio") != 0))
|
||||
return -1;
|
||||
|
||||
server = cfg_getstr(cfg_getsec(cfg, "audio"), "server");
|
||||
|
||||
ret = 0;
|
||||
|
||||
if (!(pulse.mainloop = pa_threaded_mainloop_new()))
|
||||
@@ -914,8 +917,8 @@ pulse_init(void)
|
||||
goto fail;
|
||||
|
||||
pa_context_set_state_callback(pulse.context, context_state_cb, NULL);
|
||||
|
||||
if (pa_context_connect(pulse.context, NULL, 0, NULL) < 0)
|
||||
|
||||
if (pa_context_connect(pulse.context, server, 0, NULL) < 0)
|
||||
{
|
||||
ret = pa_context_errno(pulse.context);
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user