fix recording start stop

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-09-21 16:03:08 +08:00
parent eff5dd2e03
commit e74f155cb6
8 changed files with 28 additions and 29 deletions

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");
}
}