stream: set errno to the current error

Make the state_changed event and _get_state() function set errno with
the current error value if the state is in error, so that application
can use this to give more detailed error reporting.

Use this in alsa, v4l2 and pulse to give some other error codes than
EIO.

Fixes #4574
This commit is contained in:
Wim Taymans 2025-03-04 12:50:38 +01:00
parent 491fb26f18
commit 3905e3b3d3
7 changed files with 27 additions and 7 deletions

View file

@ -391,7 +391,7 @@ static void on_stream_state_changed(void *data, enum pw_stream_state old, enum p
if (state == PW_STREAM_STATE_ERROR) {
pw_log_warn("%s", error);
pw->error = -EIO;
pw->error = -errno;
update_active(&pw->io);
}
}