File: 0089-avcodec-use-ARRAY_SIZE-instead-of-custom-code.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (22 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 6 Jan 2023 10:16:09 +0100
Subject: avcodec: use ARRAY_SIZE instead of custom code

(cherry picked from commit 28c80ee47e6cdf961f501eed9d4837956b38afd1)
---
 modules/codec/avcodec/audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index e843675..2074401 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -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;
 }