mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-loopback: unload the module on stream unconnect
When one of the streams is unconnected, unload the module. This is what happens when the node was set as dont_reconnect with a node target. Fixes #1754
This commit is contained in:
parent
e353999028
commit
26471ff2da
1 changed files with 8 additions and 1 deletions
|
|
@ -180,6 +180,14 @@ static void stream_state_changed(void *data, enum pw_stream_state old,
|
||||||
pw_stream_flush(impl->playback, false);
|
pw_stream_flush(impl->playback, false);
|
||||||
pw_stream_flush(impl->capture, false);
|
pw_stream_flush(impl->capture, false);
|
||||||
break;
|
break;
|
||||||
|
case PW_STREAM_STATE_UNCONNECTED:
|
||||||
|
pw_log_info("module %p: unconnected", impl);
|
||||||
|
pw_impl_module_schedule_destroy(impl->module);
|
||||||
|
break;
|
||||||
|
case PW_STREAM_STATE_ERROR:
|
||||||
|
pw_log_error("module %p: error: %s", impl, error);
|
||||||
|
pw_impl_module_schedule_destroy(impl->module);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -211,7 +219,6 @@ static void playback_destroy(void *d)
|
||||||
impl->playback = NULL;
|
impl->playback = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void playback_param_changed(void *data, uint32_t id, const struct spa_pod *param)
|
static void playback_param_changed(void *data, uint32_t id, const struct spa_pod *param)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue