Skip to content

Commit

Permalink
Export / Split: fix panics when the target file is read only
Browse files Browse the repository at this point in the history
  • Loading branch information
fengalin committed Apr 3, 2019
1 parent 00da795 commit 9cd3b5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/media/splitter_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl SplitterPipeline {
this.pipeline
.set_state(gst::State::Paused)
.map(|_| this)
.map_err(|_| gettext("Could not set media in Paused mode"))
.map_err(|_| gettext("do you have permission to write the file?"))
}

pub fn get_position(&self) -> Option<u64> {
Expand Down Expand Up @@ -335,11 +335,9 @@ impl SplitterPipeline {
return glib::Continue(false);
}
gst::MessageView::Error(err) => {
sender
.send(MediaEvent::FailedToExport(
err.get_error().description().to_owned(),
))
.unwrap();
let _ = sender.send(MediaEvent::FailedToExport(
err.get_error().description().to_owned(),
));
return glib::Continue(false);
}
gst::MessageView::AsyncDone(_) => {
Expand Down
10 changes: 4 additions & 6 deletions src/media/toc_setter_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl TocSetterPipeline {
this.pipeline
.set_state(gst::State::Paused)
.map(|_| this)
.map_err(|_| gettext("Could not set media in Paused mode"))
.map_err(|_| gettext("do you have permission to write the file?"))
}

pub fn get_muxer(&self) -> Option<&gst::Element> {
Expand Down Expand Up @@ -190,11 +190,9 @@ impl TocSetterPipeline {
return glib::Continue(false);
}
gst::MessageView::Error(err) => {
sender
.send(MediaEvent::FailedToExport(
err.get_error().description().to_owned(),
))
.unwrap();
let _ = sender.send(MediaEvent::FailedToExport(
err.get_error().description().to_owned(),
));
return glib::Continue(false);
}
gst::MessageView::AsyncDone(_) => {
Expand Down

0 comments on commit 9cd3b5d

Please sign in to comment.