ENH: Error handling on fn start

This commit is contained in:
o-reo 2019-02-28 12:13:40 +01:00
parent f74b0b4088
commit 1bacf8237b
2 changed files with 14 additions and 2 deletions

View file

@ -309,7 +309,13 @@ impl ObjectSubclass for NdiAudioSrc {
&settings.stream_name.clone(),
);
Ok(())
match settings.id_receiver {
0 => Err(gst_error_msg!(
gst::ResourceError::Settings,
["Could not connect to this source"]
)),
_ => Ok(())
}
}
fn stop(&self, element: &gst_base::BaseSrc) -> Result<(), gst::ErrorMessage> {

View file

@ -317,7 +317,13 @@ impl ObjectSubclass for NdiVideoSrc {
);
// settings.id_receiver != 0
Ok(())
match settings.id_receiver {
0 => Err(gst_error_msg!(
gst::ResourceError::Settings,
["Could not connect to this source"]
)),
_ => Ok(())
}
}
fn stop(&self, element: &gst_base::BaseSrc) -> Result<(), gst::ErrorMessage> {