mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-23 12:01:01 +00:00
threadshare/udpsink: don't error out when socket can't be prepared for protocol
Instead, error out at chain time if a client with the unavailable protocol (eg IPv6) has been added.
This commit is contained in:
parent
b8f8705c47
commit
bcbf862ded
1 changed files with 23 additions and 7 deletions
|
@ -527,6 +527,14 @@ impl UdpSink {
|
|||
);
|
||||
gst::FlowError::Error
|
||||
})?;
|
||||
} else {
|
||||
gst_element_error!(
|
||||
element,
|
||||
gst::StreamError::Failed,
|
||||
("I/O error"),
|
||||
["No socket available for sending to {}", client]
|
||||
);
|
||||
return Err(gst::FlowError::Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -617,13 +625,21 @@ impl UdpSink {
|
|||
net2::UdpBuilder::new_v6()
|
||||
} else {
|
||||
net2::UdpBuilder::new_v4()
|
||||
}
|
||||
.map_err(|err| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::OpenWrite,
|
||||
["Failed to create socket: {}", err]
|
||||
)
|
||||
})?;
|
||||
};
|
||||
|
||||
let builder = match builder {
|
||||
Ok(builder) => builder,
|
||||
Err(err) => {
|
||||
gst_warning!(
|
||||
CAT,
|
||||
obj: element,
|
||||
"Failed to create {} socket builder: {}",
|
||||
if ipv6 { "IPv6" } else { "IPv4" },
|
||||
err
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
let socket = builder.bind(&saddr).map_err(|err| {
|
||||
gst_error_msg!(
|
||||
|
|
Loading…
Reference in a new issue