aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/videotoolbox.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-04 15:39:00 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-07 22:34:28 +0200
commit2db94a96c890be232e09fb79b49480fbc94610b5 (patch)
tree9017b7cb862f8c61231f376414ad0fd8a5770c3a /libavcodec/videotoolbox.c
parent787351a68e9f3cbe46c3dcf6d0d9b001bcd139b3 (diff)
downloadffmpeg-2db94a96c890be232e09fb79b49480fbc94610b5.tar.gz
avcodec/hevc_ps: Use RefStruct API for parameter sets
Avoids allocations and error checks for these allocations; e.g. syncing buffers across threads can't fail any more and needn't be checked. It also gets rid of casts and indirections. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 963379d483..43fd2e3fea 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -246,7 +246,7 @@ CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx)
#define COUNT_SIZE_PS(T, t) \
for (i = 0; i < HEVC_MAX_##T##PS_COUNT; i++) { \
if (h->ps.t##ps_list[i]) { \
- const HEVC##T##PS *lps = (const HEVC##T##PS *)h->ps.t##ps_list[i]->data; \
+ const HEVC##T##PS *lps = h->ps.t##ps_list[i]; \
vt_extradata_size += 2 + escape_ps(NULL, lps->data, lps->data_size); \
num_##t##ps++; \
} \
@@ -369,7 +369,7 @@ CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx)
p += 3; \
for (i = 0; i < HEVC_MAX_##T##PS_COUNT; i++) { \
if (h->ps.t##ps_list[i]) { \
- const HEVC##T##PS *lps = (const HEVC##T##PS *)h->ps.t##ps_list[i]->data; \
+ const HEVC##T##PS *lps = h->ps.t##ps_list[i]; \
int size = escape_ps(p + 2, lps->data, lps->data_size); \
/* unsigned int(16) nalUnitLength; */ \
AV_WB16(p, size); \