fix recording start stop

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages committed 2022-09-22 09:57:52 +08:00
1 parent eff5dd2e03
commit e74f155cb6
8 files changed
+28 -29

No files matched your search

-2
View File
@@ -298,11 +298,9 @@ impl RecorderApi for HwRecorder {
#[cfg(feature = "hwcodec")]
impl Drop for HwRecorder {
fn drop(&mut self) {
log::info!("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD {}", self.ctx.filename);
self.muxer.write_tail().ok();
if !self.written || self.start.elapsed().as_secs() < MIN_SECS {
std::fs::remove_file(&self.ctx.filename).ok();
}
log::info!("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ok");
}
}