modules: don't unload on stream errors

It's possible that the stream is sent an error when the session manager
can't link the node (because, for example, the sink/source is not
available yet). We should not stop but just log this error.

When the session manager actively kills the stream (when it is
reconnected while the DONT_RECONNECT flag is true) we will end up in the
UNCONNECTED state and that's when we can unload the module.
This commit is contained in:
Wim Taymans 2022-04-21 09:02:02 +02:00
parent f205a09ade
commit 01a7d6709b
3 changed files with 4 additions and 8 deletions

View file

@ -406,8 +406,7 @@ static void input_state_changed(void *data, enum pw_stream_state old,
pw_impl_module_schedule_destroy(impl->module); pw_impl_module_schedule_destroy(impl->module);
break; break;
case PW_STREAM_STATE_ERROR: case PW_STREAM_STATE_ERROR:
pw_log_error("%p: input error: %s", impl, error); pw_log_info("%p: input error: %s", impl, error);
pw_impl_module_schedule_destroy(impl->module);
break; break;
default: default:
break; break;
@ -479,8 +478,7 @@ static void output_state_changed(void *data, enum pw_stream_state old,
pw_impl_module_schedule_destroy(impl->module); pw_impl_module_schedule_destroy(impl->module);
break; break;
case PW_STREAM_STATE_ERROR: case PW_STREAM_STATE_ERROR:
pw_log_error("%p: output error: %s", impl, error); pw_log_info("%p: output error: %s", impl, error);
pw_impl_module_schedule_destroy(impl->module);
break; break;
default: default:
break; break;

View file

@ -610,8 +610,7 @@ static void state_changed(void *data, enum pw_stream_state old,
pw_impl_module_schedule_destroy(impl->module); pw_impl_module_schedule_destroy(impl->module);
break; break;
case PW_STREAM_STATE_ERROR: case PW_STREAM_STATE_ERROR:
pw_log_error("module %p: error: %s", impl, error); pw_log_info("module %p: error: %s", impl, error);
pw_impl_module_schedule_destroy(impl->module);
break; break;
default: default:
break; break;

View file

@ -185,8 +185,7 @@ static void stream_state_changed(void *data, enum pw_stream_state old,
pw_impl_module_schedule_destroy(impl->module); pw_impl_module_schedule_destroy(impl->module);
break; break;
case PW_STREAM_STATE_ERROR: case PW_STREAM_STATE_ERROR:
pw_log_error("module %p: error: %s", impl, error); pw_log_info("module %p: error: %s", impl, error);
pw_impl_module_schedule_destroy(impl->module);
break; break;
default: default:
break; break;