aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_d3d11va.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-02-11 22:16:32 +0100
committerJames Almer <jamrial@gmail.com>2024-03-07 08:53:31 -0300
commit3e669b24e282594ab92ef50c839bb1fdc01331b4 (patch)
tree2b11f6af5630dae3717866cbb7cf5c2be64c1e64 /libavutil/hwcontext_d3d11va.c
parenta0b9b96269b48298eddb927059cb4dfea6725167 (diff)
downloadffmpeg-3e669b24e282594ab92ef50c839bb1fdc01331b4.tar.gz
avutil/hwcontext: Allocate AVHWFramesCtx jointly with its internals
This is possible because the lifetime of these structures coincide. It has the advantage of allowing to remove AVHWFramesInternal from the public header; given that AVHWFramesInternal.priv is no more, most accesses to AVHWFramesInternal are no more; indeed, the only field accessed of it outside of hwcontext.c is the internal frame pool, making this commit very simple. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavutil/hwcontext_d3d11va.c')
-rw-r--r--libavutil/hwcontext_d3d11va.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index 19fcf37a84..24b3546e7b 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -319,9 +319,10 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx)
return AVERROR(ENOMEM);
s->nb_surfaces = ctx->initial_pool_size;
- ctx->internal->pool_internal = av_buffer_pool_init2(sizeof(AVD3D11FrameDescriptor),
- ctx, d3d11va_pool_alloc, NULL);
- if (!ctx->internal->pool_internal)
+ ffhwframesctx(ctx)->pool_internal =
+ av_buffer_pool_init2(sizeof(AVD3D11FrameDescriptor),
+ ctx, d3d11va_pool_alloc, NULL);
+ if (!ffhwframesctx(ctx)->pool_internal)
return AVERROR(ENOMEM);
return 0;