From f58d68b2f4d8d15841e27d6af05dc24ea32efddd Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 22 May 2025 22:44:56 +0200 Subject: [PATCH 3/3] avcodec/asvenc: Simplify writing extradata It is confusing, because the AV_RL32("ASUS") already returns an endian-independent value, so converting it via av_le2ne32() makes no real sense: one would need to transform the native value to le and write it as a natie endian uint32_t for it to make sense (the current code only works because le2ne32 and ne2le32 are the same for both endianness that we care about). Or one can just use AV_RL32 and create the number via MKTAG(). Signed-off-by: Andreas Rheinhardt --- libavcodec/asvenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index 2f81d6c74b..bcdb5cfbe2 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -379,8 +379,8 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!avctx->extradata) return AVERROR(ENOMEM); avctx->extradata_size = 8; - AV_WLA(32, avctx->extradata, inv_qscale); - ((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS")); + AV_WL32A(avctx->extradata, inv_qscale); + AV_WL32A(avctx->extradata + 4, MKTAG('A', 'S', 'U', 'S')); for (i = 0; i < 64; i++) { if (a->fdsp.fdct == ff_fdct_ifast) { -- 2.45.2