diff mbox series

[FFmpeg-devel] Remove struct named initializer from aac profile option.

Message ID 20240326084202.47498-1-muiz.rpi@gmail.com
State New
Headers show
Series [FFmpeg-devel] Remove struct named initializer from aac profile option. | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Muiz Yusuff March 26, 2024, 8:42 a.m. UTC
From: Muiz <muiz.dev@gmail.com>

All fields of the stuct use unnamed struct initialization.
Also omit the field name for `AVOption::unit` to maintain consistency.
---
 libavcodec/profiles.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hendrik Leppkes March 26, 2024, 8:49 a.m. UTC | #1
On Tue, Mar 26, 2024 at 9:42 AM Muiz Yusuff <muiz.rpi@gmail.com> wrote:
>
> From: Muiz <muiz.dev@gmail.com>
>
> All fields of the stuct use unnamed struct initialization.
> Also omit the field name for `AVOption::unit` to maintain consistency.

"unit" intentionally uses designated initializers, so that adding new
fields before it is more robust and less prone to errors.

See 1e7d2007c3aca1cc1cd3b1ca409f4ded6c885f86

- Hendrik
diff mbox series

Patch

diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index ffc8710ef2..270430a48b 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -23,7 +23,7 @@ 
 #include "libavutil/opt.h"
 
 #define FF_AVCTX_PROFILE_OPTION(name, description, type, value) \
-    {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, .unit = "avctx.profile"},
+    {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"},
 
 #define FF_AAC_PROFILE_OPTS \
     FF_AVCTX_PROFILE_OPTION("aac_main",      NULL, AUDIO, AV_PROFILE_AAC_MAIN)\