modules: don't unload module on stream error

Unloading the module on stream errors is a bit too much because a
suspend can clear the stream error again (or the error might not be
fatal)

This can happen for example when negotiation fails on some stream ports
(wireplumber tries to link the midi ports to audio ports) and it's
better to not completely fail on that.

Fixes #4121
This commit is contained in:
Wim Taymans 2024-07-18 14:15:22 +02:00
parent 32e4553a05
commit 280bbd88d4
4 changed files with 9 additions and 3 deletions

View file

@ -548,8 +548,8 @@ static void stream_state_changed(void *d, enum pw_filter_state old,
struct impl *impl = s->impl;
switch (state) {
case PW_FILTER_STATE_ERROR:
pw_log_error("filter state %d error: %s", state, error);
SPA_FALLTHROUGH;
pw_log_warn("filter state %d error: %s", state, error);
break;
case PW_FILTER_STATE_UNCONNECTED:
pw_impl_module_schedule_destroy(impl->module);
break;

View file

@ -306,10 +306,12 @@ static void stream_state_changed(void *d, enum pw_filter_state old,
struct stream *s = d;
struct impl *impl = s->impl;
switch (state) {
case PW_FILTER_STATE_ERROR:
case PW_FILTER_STATE_UNCONNECTED:
pw_impl_module_schedule_destroy(impl->module);
break;
case PW_FILTER_STATE_ERROR:
pw_log_warn("stream %p: error: %s", s, error);
break;
case PW_FILTER_STATE_PAUSED:
s->running = false;
break;

View file

@ -274,6 +274,8 @@ static void stream_state_changed(void *d, enum pw_filter_state old,
struct impl *impl = s->impl;
switch (state) {
case PW_FILTER_STATE_ERROR:
pw_log_warn("stream %s: error: %s", s, error);
break;
case PW_FILTER_STATE_UNCONNECTED:
pw_impl_module_schedule_destroy(impl->module);
break;

View file

@ -297,6 +297,8 @@ static void stream_state_changed(void *d, enum pw_filter_state old,
struct impl *impl = s->impl;
switch (state) {
case PW_FILTER_STATE_ERROR:
pw_log_warn("stream %s: error: %s", s, error);
break;
case PW_FILTER_STATE_UNCONNECTED:
pw_impl_module_schedule_destroy(impl->module);
break;