avcodec: use ARRAY_SIZE instead of custom code
authorSteve Lhomme <robux4@ycbcr.xyz>
Fri, 6 Jan 2023 09:16:09 +0000 (10:16 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 14 Jan 2025 22:09:47 +0000 (23:09 +0100)
(cherry picked from commit 28c80ee47e6cdf961f501eed9d4837956b38afd1)

Gbp-Pq: Name 0089-avcodec-use-ARRAY_SIZE-instead-of-custom-code.patch

modules/codec/avcodec/audio.c

index e8436754f4a54ae82838a12510185a5fdf69c71f..20744010433bcd890a920a6aab1271943578062c 100644 (file)
@@ -558,7 +558,7 @@ vlc_fourcc_t GetVlcAudioFormat( int fmt )
         [AV_SAMPLE_FMT_FLTP]  = VLC_CODEC_FL32,
         [AV_SAMPLE_FMT_DBLP]  = VLC_CODEC_FL64,
     };
-    if( (sizeof(fcc) / sizeof(fcc[0])) > (unsigned)fmt )
+    if( ARRAY_SIZE(fcc) > (unsigned)fmt )
         return fcc[fmt];
     return VLC_CODEC_S16N;
 }