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

This reverts commit 1fd7542eae.
This commit is contained in:
Adeeb Shihadeh
2023-06-11 08:27:09 -07:00
parent 96420555e5
commit 5161c23645
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;
}