aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms_cuda.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-10-22 04:56:34 +0200
committerdec05eba <dec05eba@protonmail.com>2023-10-22 04:56:34 +0200
commit51154b71be6be742541f53a21b5c9d39d0033270 (patch)
tree348cc95ce90744c14884b2821136586b5ea8ed09 /src/capture/kms_cuda.c
parent44d50065b92284638398b4989490ac66eb34c53e (diff)
Fix vram leak for reals
Diffstat (limited to 'src/capture/kms_cuda.c')
-rw-r--r--src/capture/kms_cuda.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/capture/kms_cuda.c b/src/capture/kms_cuda.c
index 13636aa..e7f7ea5 100644
--- a/src/capture/kms_cuda.c
+++ b/src/capture/kms_cuda.c
@@ -424,6 +424,13 @@ static int gsr_capture_kms_cuda_capture(gsr_capture *cap, AVFrame *frame) {
gsr_capture_kms_unload_cuda_graphics(cap_kms);
+ return 0;
+}
+
+static void gsr_capture_kms_cuda_capture_end(gsr_capture *cap, AVFrame *frame) {
+ (void)frame;
+ gsr_capture_kms_cuda *cap_kms = cap->priv;
+
gsr_egl_cleanup_frame(cap_kms->params.egl);
for(int i = 0; i < cap_kms->kms_response.num_fds; ++i) {
@@ -432,8 +439,6 @@ static int gsr_capture_kms_cuda_capture(gsr_capture *cap, AVFrame *frame) {
cap_kms->kms_response.fds[i].fd = 0;
}
cap_kms->kms_response.num_fds = 0;
-
- return 0;
}
static void gsr_capture_kms_cuda_stop(gsr_capture *cap, AVCodecContext *video_codec_context) {
@@ -501,6 +506,7 @@ gsr_capture* gsr_capture_kms_cuda_create(const gsr_capture_kms_cuda_params *para
.tick = gsr_capture_kms_cuda_tick,
.should_stop = gsr_capture_kms_cuda_should_stop,
.capture = gsr_capture_kms_cuda_capture,
+ .capture_end = gsr_capture_kms_cuda_capture_end,
.destroy = gsr_capture_kms_cuda_destroy,
.priv = cap_kms
};