No need to stop pipeline inside signal handler

This commit is contained in:
Rafael Caricio 2023-03-26 01:07:10 +01:00
parent c189d88fdb
commit c31409d242
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947

View file

@ -67,11 +67,8 @@ fn main() -> Result<()> {
}); });
ctrlc::set_handler({ ctrlc::set_handler({
let pipeline_weak = pipeline.downgrade();
let main_loop = main_loop.clone(); let main_loop = main_loop.clone();
move || { move || {
let pipeline = pipeline_weak.upgrade().unwrap();
pipeline.set_state(gst::State::Null).unwrap();
main_loop.quit(); main_loop.quit();
} }
})?; })?;