[FFmpeg-cvslog] avcodec/v408enc: Deduplicate pix_fmts arrays

Andreas Rheinhardt git at videolan.org
Wed May 5 15:38:36 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue May  4 20:51:09 2021 +0200| [7bfa533793cc18eeab9f127e1be795260f6db108] | committer: Andreas Rheinhardt

avcodec/v408enc: Deduplicate pix_fmts arrays

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7bfa533793cc18eeab9f127e1be795260f6db108
---

 libavcodec/v408enc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c
index 7024420ca3..e786f71f06 100644
--- a/libavcodec/v408enc.c
+++ b/libavcodec/v408enc.c
@@ -75,6 +75,8 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     return 0;
 }
 
+static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE };
+
 #if CONFIG_AYUV_ENCODER
 const AVCodec ff_ayuv_encoder = {
     .name         = "ayuv",
@@ -84,7 +86,7 @@ const AVCodec ff_ayuv_encoder = {
     .capabilities = AV_CODEC_CAP_DR1,
     .init         = v408_encode_init,
     .encode2      = v408_encode_frame,
-    .pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE },
+    .pix_fmts     = pix_fmt,
     .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif
@@ -97,7 +99,7 @@ const AVCodec ff_v408_encoder = {
     .capabilities = AV_CODEC_CAP_DR1,
     .init         = v408_encode_init,
     .encode2      = v408_encode_frame,
-    .pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE },
+    .pix_fmts     = pix_fmt,
     .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif



More information about the ffmpeg-cvslog mailing list