aboutsummaryrefslogtreecommitdiff
path: root/src/encoder
diff options
context:
space:
mode:
authorFaker0715 <949506563@qq.com>2024-09-05 11:08:08 +0800
committerdec05eba <dec05eba@protonmail.com>2024-09-05 20:30:13 +0200
commitcb782763f03b146df43344992a82007ad616c8b9 (patch)
tree2be22349406be0588e594a13580a985d023ba551 /src/encoder
parent98f75b273bf2df1fc66566f38f48e0753f6742d9 (diff)
More cleanup hwdevice ctx
Diffstat (limited to 'src/encoder')
-rw-r--r--src/encoder/video/cuda.c1
-rw-r--r--src/encoder/video/vaapi.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/encoder/video/cuda.c b/src/encoder/video/cuda.c
index 9681418..a323940 100644
--- a/src/encoder/video/cuda.c
+++ b/src/encoder/video/cuda.c
@@ -62,6 +62,7 @@ static bool gsr_video_encoder_cuda_setup_context(gsr_video_encoder_cuda *self, A
self->cuda_stream = cuda_device_context->stream;
video_codec_context->hw_frames_ctx = av_buffer_ref(frame_context);
+ av_buffer_unref(&frame_context);
return true;
}
diff --git a/src/encoder/video/vaapi.c b/src/encoder/video/vaapi.c
index e96319f..7a2abfc 100644
--- a/src/encoder/video/vaapi.c
+++ b/src/encoder/video/vaapi.c
@@ -63,6 +63,7 @@ static bool gsr_video_encoder_vaapi_setup_context(gsr_video_encoder_vaapi *self,
}
video_codec_context->hw_frames_ctx = av_buffer_ref(frame_context);
+ av_buffer_unref(&frame_context);
return true;
}