fix borrow_mut error

This commit is contained in:
ochibani 2025-01-04 20:32:32 +02:00
parent 3e19d0af31
commit 4b3c8d7d9f
3 changed files with 97 additions and 97 deletions

View File

@ -428,7 +428,7 @@ impl Ffmpeg {
#[cfg(feature = "gtk")]
impl Ffmpeg {
// Get file name
pub fn get_filename(&mut self) -> Result<String> {
pub fn get_filename(&mut self) -> Result<()> {
self.saved_filename =
self.filename
.0
@ -448,7 +448,7 @@ impl Ffmpeg {
.as_path()
.display()
.to_string();
Ok(self.saved_filename.clone())
Ok(())
}
// Start video recording

View File

@ -419,7 +419,7 @@ impl Ffmpeg {
#[cfg(feature = "gtk")]
impl Ffmpeg {
// Get file name
pub fn get_filename(&mut self) -> Result<String> {
pub fn get_filename(&mut self) -> Result<()> {
self.saved_filename =
self.filename
.0
@ -439,7 +439,7 @@ impl Ffmpeg {
.as_path()
.display()
.to_string();
Ok(self.saved_filename.clone())
Ok(())
}
// Start video recording

View File

@ -820,6 +820,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
_error_dialog.show();
},
Ok(_) => {
// Continue
},
}
if !_audio_input_switch.is_active() &&
!_audio_output_switch.is_active() &&
!_video_switch.is_active() ||
@ -915,8 +918,6 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
}
}
}
},
}
});
// Stop record button
@ -1097,9 +1098,8 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
});
// Stop recording before close the application
let mut _ffmpeg_record_interface = ffmpeg_record_interface.clone();
main_window.connect_close_request(move |main_window| {
_ffmpeg_record_interface.borrow_mut().kill().unwrap();
ffmpeg_record_interface.borrow_mut().kill().unwrap();
main_window.destroy();
adw::gtk::Inhibit(true)
});