[vlc-commits] [Git][videolan/vlc][master] aout: use static assert for fallbacks

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Oct 10 07:49:16 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ee762046 by François Cartegnie at 2024-10-10T07:33:09+00:00
aout: use static assert for fallbacks

- - - - -


1 changed file:

- src/audio_output/output.c


Changes:

=====================================
src/audio_output/output.c
=====================================
@@ -747,10 +747,10 @@ int aout_OutputNew(audio_output_t *aout, vlc_aout_stream *stream,
     {
         switch (fmt->i_format)
         {
+            static_assert(ARRAY_SIZE(formats) >= 3, "fallback array too small");
             case VLC_CODEC_DTS:
                 if (input_profile > 0)
                 {
-                    assert(ARRAY_SIZE(formats) >= 3);
                     /* DTSHD can be played as DTSHD or as DTS */
                     formats[0] = VLC_CODEC_DTSHD;
                     formats[1] = VLC_CODEC_DTS;
@@ -759,7 +759,6 @@ int aout_OutputNew(audio_output_t *aout, vlc_aout_stream *stream,
             case VLC_CODEC_A52:
                 if (input_profile > 0)
                 {
-                    assert(ARRAY_SIZE(formats) >= 3);
                     formats[0] = VLC_CODEC_EAC3;
                     formats[1] = VLC_CODEC_A52;
                 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ee762046a00e5fe501dabdbb9ba757c2bb597766

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ee762046a00e5fe501dabdbb9ba757c2bb597766
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list