Revert "Encoderd: encoders just encode, no writing (#28482)"

This reverts commit eed43696f113feeac757b147a782b8c063638a63.

old-commit-hash: 5161c2364538236b51674fbc63c7f9666e95928b
This commit is contained in:
Adeeb Shihadeh
2023-06-11 08:27:09 -07:00
parent c167ae232f
commit 22882d740c
7 changed files with 70 additions and 8 deletions
+2
View File
@@ -60,6 +60,7 @@ void FfmpegEncoder::encoder_open(const char* path) {
int err = avcodec_open2(this->codec_ctx, codec, NULL);
assert(err >= 0);
writer_open(path);
is_open = true;
segment_num++;
counter = 0;
@@ -68,6 +69,7 @@ void FfmpegEncoder::encoder_open(const char* path) {
void FfmpegEncoder::encoder_close() {
if (!is_open) return;
writer_close();
avcodec_free_context(&codec_ctx);
is_open = false;
}