fix: free muxer context on reset

This commit is contained in:
kieran 2024-11-29 23:12:07 +00:00
parent 8e102423d4
commit 464ec32898
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -355,6 +355,7 @@ impl Muxer {
pub unsafe fn reset(&mut self) -> Result<()> { pub unsafe fn reset(&mut self) -> Result<()> {
let ret = av_write_trailer(self.ctx); let ret = av_write_trailer(self.ctx);
bail_ffmpeg!(ret); bail_ffmpeg!(ret);
avformat_free_context(self.ctx);
self.ctx = ptr::null_mut(); self.ctx = ptr::null_mut();
Ok(()) Ok(())
} }