mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-06 04:06:36 -05:00
module-rtp: handle state change errors better
Make a new function to set the rtp stream in the error state. When we fail to start the stream, set the error state. Otherwise (like when we try to use an invalid interface name) the socket create will fail but the stream will still try to send data to the invalid socket.
This commit is contained in:
parent
6e7b893448
commit
4ffd74ef46
4 changed files with 14 additions and 3 deletions
|
|
@ -642,6 +642,12 @@ void rtp_stream_set_first(struct rtp_stream *s)
|
|||
impl->first = true;
|
||||
}
|
||||
|
||||
void rtp_stream_set_error(struct rtp_stream *s, int res, const char *error)
|
||||
{
|
||||
struct impl *impl = (struct impl*)s;
|
||||
pw_stream_set_error(impl->stream, res, "%s: %s", error, spa_strerror(res));
|
||||
}
|
||||
|
||||
enum pw_stream_state rtp_stream_get_state(struct rtp_stream *s, const char **error)
|
||||
{
|
||||
struct impl *impl = (struct impl*)s;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue