mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-05 04:06:37 -05:00
stream: on EPROTO core error, set streams & filters to error state
If core emits EPROTO error, there is some protocol error with server communication that may not be recoverable (eg. ran out of fds) and previous operations may not have completed correctly. When it occurs, transition all streams & filters using the connection to error state, as they may not be in valid state. E.g. if pipewire-pulse is told to PLAY_SAMPLE many samples at the same time, this error occurs and sample-play.c streams never enter STREAMING, never releasing the fds they allocated and the server hits the max fd limit.
This commit is contained in:
parent
69d8822303
commit
a68a4b0328
2 changed files with 6 additions and 0 deletions
|
|
@ -1159,6 +1159,9 @@ static void on_core_error(void *_data, uint32_t id, int seq, int res, const char
|
|||
|
||||
if (id == PW_ID_CORE && res == -EPIPE) {
|
||||
filter_set_state(filter, PW_FILTER_STATE_UNCONNECTED, res, message);
|
||||
} else if (id == PW_ID_CORE && res == -EPROTO) {
|
||||
pw_filter_set_active(filter, false);
|
||||
filter_set_state(filter, PW_FILTER_STATE_ERROR, res, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1508,6 +1508,9 @@ static void on_core_error(void *data, uint32_t id, int seq, int res, const char
|
|||
|
||||
if (id == PW_ID_CORE && res == -EPIPE) {
|
||||
stream_set_state(stream, PW_STREAM_STATE_UNCONNECTED, res, message);
|
||||
} else if (id == PW_ID_CORE && res == -EPROTO) {
|
||||
pw_stream_set_active(stream, false);
|
||||
stream_set_state(stream, PW_STREAM_STATE_ERROR, res, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue