pipeline: set state to stop when error

Do not display a dialog when an error happens,
only a log error is sufficient.
This commit is contained in:
Stéphane Cerveau 2022-01-25 11:53:36 +01:00
parent 13421b4d5b
commit 5c25417569
2 changed files with 3 additions and 11 deletions

View file

@ -19,7 +19,6 @@
use crate::graphmanager::{GraphView, Node, NodeType, PortDirection, PropertyExt};
use crate::logger;
use crate::ui::message as GPSMessage;
use crate::GPS_INFO;
use gst::glib;
@ -157,16 +156,8 @@ impl Pipeline {
err.error(),
err.debug()
);
GPSMessage::display_error_dialog(
false,
format!(
"Error from {:?}: {} ({:?})",
err.src().map(|s| s.path_string()),
err.error(),
err.debug()
)
.as_str(),
);
self.set_state(PipelineState::Stopped)
.expect("Unable to set state to stopped");
}
MessageView::Application(msg) => match msg.structure() {
// Here we can send ourselves messages from any thread and show them to the user in

View file

@ -61,6 +61,7 @@ pub fn display_message_dialog<F: Fn(Application) + 'static>(
dialog.show();
}
#[allow(dead_code)]
pub fn display_error_dialog(fatal: bool, message: &str) {
display_message_dialog(message, gtk::MessageType::Error, move |app| {
if fatal {