mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
alsa: avoid crash when connection fails
Set the client api in properties
This commit is contained in:
parent
e8b0422514
commit
5d30ccfaff
1 changed files with 3 additions and 2 deletions
|
|
@ -370,7 +370,7 @@ static int snd_pcm_pipewire_prepare(snd_pcm_ioplug_t *io)
|
||||||
pw->stream = NULL;
|
pw->stream = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
props = pw_properties_new(NULL, NULL);
|
props = pw_properties_new("client.api", "alsa", NULL);
|
||||||
pw_properties_setf(props, "node.latency", "%lu", io->period_size);
|
pw_properties_setf(props, "node.latency", "%lu", io->period_size);
|
||||||
|
|
||||||
pw->stream = pw_stream_new(pw->remote, pw->node_name, props);
|
pw->stream = pw_stream_new(pw->remote, pw->node_name, props);
|
||||||
|
|
@ -583,6 +583,7 @@ static void on_remote_state_changed(void *data, enum pw_remote_state old,
|
||||||
pw_log_error("error %s", error);
|
pw_log_error("error %s", error);
|
||||||
case PW_REMOTE_STATE_UNCONNECTED:
|
case PW_REMOTE_STATE_UNCONNECTED:
|
||||||
pw->error = true;
|
pw->error = true;
|
||||||
|
if (pw->fd != -1)
|
||||||
pcm_poll_unblock_check(&pw->io);
|
pcm_poll_unblock_check(&pw->io);
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case PW_REMOTE_STATE_CONNECTED:
|
case PW_REMOTE_STATE_CONNECTED:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue