From 51154b71be6be742541f53a21b5c9d39d0033270 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 22 Oct 2023 04:56:34 +0200 Subject: Fix vram leak for reals --- src/capture/capture.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/capture/capture.c') diff --git a/src/capture/capture.c b/src/capture/capture.c index 699745a..eea0d1d 100644 --- a/src/capture/capture.c +++ b/src/capture/capture.c @@ -42,6 +42,18 @@ int gsr_capture_capture(gsr_capture *cap, AVFrame *frame) { return cap->capture(cap, frame); } +void gsr_capture_end(gsr_capture *cap, AVFrame *frame) { + if(!cap->started) { + fprintf(stderr, "gsr error: gsr_capture_end failed: the gsr capture has not been started\n"); + return; + } + + if(!cap->capture_end) + return; + + cap->capture_end(cap, frame); +} + void gsr_capture_destroy(gsr_capture *cap, AVCodecContext *video_codec_context) { cap->destroy(cap, video_codec_context); } -- cgit v1.2.3