- uint8_t *buf = (uint8_t *)av_malloc(MUX_BUFFER_SIZE);
- avctx->pb = avio_alloc_context(buf, MUX_BUFFER_SIZE, 1, this, nullptr, nullptr, nullptr);
- avctx->pb->write_data_type = &VideoStream::write_packet2_thunk;
- avctx->pb->ignore_boundary_point = 1;
+ for (const unique_ptr<InterpolatedFrameResources> &resource : interpolate_resources) {
+ glUnmapNamedBuffer(resource->pbo);
+ check_error();
+ glDeleteBuffers(1, &resource->pbo);
+ check_error();
+ glDeleteFramebuffers(2, resource->input_fbos);
+ check_error();
+ glDeleteFramebuffers(1, &resource->fade_fbo);
+ check_error();
+ glDeleteTextures(1, &resource->input_tex);
+ check_error();
+ glDeleteTextures(1, &resource->gray_tex);
+ check_error();
+ glDeleteTextures(1, &resource->fade_y_output_tex);
+ check_error();
+ glDeleteTextures(1, &resource->fade_cbcr_output_tex);
+ check_error();
+ glDeleteTextures(1, &resource->cb_tex);
+ check_error();
+ glDeleteTextures(1, &resource->cr_tex);
+ check_error();
+ }
+ assert(interpolate_resources.size() == num_interpolate_slots);
+}