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

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


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Apr 27 19:57:57 2021 +0200| [184a8852f1c4a3c592fa0a4e1dcb253d6456cbe8] | committer: Andreas Rheinhardt

avcodec/r210enc: 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=184a8852f1c4a3c592fa0a4e1dcb253d6456cbe8
---

 libavcodec/r210enc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index 5e781ed20b..76271e2749 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -86,6 +86,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     return 0;
 }
 
+static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE };
 
 #if CONFIG_R210_ENCODER
 const AVCodec ff_r210_encoder = {
@@ -96,7 +97,7 @@ const AVCodec ff_r210_encoder = {
     .capabilities   = AV_CODEC_CAP_DR1,
     .init           = encode_init,
     .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE },
+    .pix_fmts       = pix_fmt,
     .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif
@@ -109,7 +110,7 @@ const AVCodec ff_r10k_encoder = {
     .capabilities   = AV_CODEC_CAP_DR1,
     .init           = encode_init,
     .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE },
+    .pix_fmts       = pix_fmt,
     .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif
@@ -122,7 +123,7 @@ const AVCodec ff_avrp_encoder = {
     .capabilities   = AV_CODEC_CAP_DR1,
     .init           = encode_init,
     .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE },
+    .pix_fmts       = pix_fmt,
     .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };
 #endif



More information about the ffmpeg-cvslog mailing list