[fix]: crash on missing video
This commit is contained in:
parent
17b71e7ba3
commit
cdbeccc8a3
1 changed files with 12 additions and 6 deletions
|
|
@ -195,17 +195,23 @@ impl VideoEditor {
|
|||
|
||||
fn update_entire_video(&mut self, video: &videos::Video) {
|
||||
debug!(?video);
|
||||
let Ok(mut player_video) =
|
||||
Url::from_file_path(video.path.clone()).map(|url| {
|
||||
gst_video::create_video(&url, 60)
|
||||
.expect("Shouldn't have probs")
|
||||
})
|
||||
else {
|
||||
let Ok(url) = Url::from_file_path(video.path.clone()) else {
|
||||
self.video = None;
|
||||
self.title.clone_from(&video.title);
|
||||
self.core_video = Some(video.clone());
|
||||
return;
|
||||
};
|
||||
let Ok(mut player_video) = gst_video::create_video(&url, 60)
|
||||
else {
|
||||
self.video = None;
|
||||
self.title = format!(
|
||||
"{}: {}",
|
||||
String::from("Video Missing"),
|
||||
&video.title
|
||||
);
|
||||
self.core_video = Some(video.clone());
|
||||
return;
|
||||
};
|
||||
player_video.set_paused(true);
|
||||
self.video = Some(player_video);
|
||||
self.title.clone_from(&video.title);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue