[vlc-commits] [Git][videolan/vlc][master] 9 commits: chroma: cvpx: fix unused variable warning

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Sep 24 08:58:14 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
aae0f2db by Marvin Scholz at 2025-09-24T08:41:05+00:00
chroma: cvpx: fix unused variable warning

- - - - -
eb5897d4 by Marvin Scholz at 2025-09-24T08:41:05+00:00
macosx: do not omit parameter names

avoids the following warning:
  warning: omitting the parameter name in a function definition is a
  C23 extension [-Wc23-extensions]

- - - - -
e689fee7 by Marvin Scholz at 2025-09-24T08:41:05+00:00
libvlc: silence different enums comparison warning

Avoids the following warning:
  comparison of different enumeration types
  ('enum libvlc_video_stereo_mode_t' and 'enum vlc_stereoscopic_mode_t')

- - - - -
b84e11b8 by Marvin Scholz at 2025-09-24T08:41:05+00:00
access: dvdread: avoid unused variable warning

Avoids an unused variable warning when building against a dvdread
version that doesn't support DVD Audio.

- - - - -
670abe66 by Marvin Scholz at 2025-09-24T08:41:05+00:00
access: dvdread: remove trailing whitespace

- - - - -
739cc675 by Marvin Scholz at 2025-09-24T08:41:05+00:00
codec: dvbsub: remove unused variable

This was added in 920f0addc5909e21ad9fd51c2b7ddfc02ab3f428 but  not
actually used.

- - - - -
a8381789 by Marvin Scholz at 2025-09-24T08:41:05+00:00
vout: opengl: silence unused variable warning

- - - - -
c31168bc by Marvin Scholz at 2025-09-24T08:41:05+00:00
codec: ass: fix VLA folded to constant array

Just set the size of the array directly and use the array size.

- - - - -
b8f5485e by Marvin Scholz at 2025-09-24T08:41:05+00:00
codec: cc: fix VLA folded to constant array

Just set the size of the array directly and use the array size.

- - - - -


8 changed files:

- lib/video.c
- modules/access/dvdread.c
- modules/codec/cc.c
- modules/codec/dvbsub.c
- modules/codec/libass.c
- modules/gui/macosx/playqueue/VLCPlaybackContinuityController.m
- modules/video_chroma/cvpx.c
- modules/video_output/opengl/display.c


Changes:

=====================================
lib/video.c
=====================================
@@ -310,11 +310,11 @@ int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
 
 libvlc_video_stereo_mode_t libvlc_video_get_video_stereo_mode(libvlc_media_player_t *p_mi)
 {
-    static_assert( libvlc_VideoStereoAuto       == VIDEO_STEREO_OUTPUT_AUTO &&
-                   libvlc_VideoStereoStereo     == VIDEO_STEREO_OUTPUT_STEREO &&
-                   libvlc_VideoStereoLeftEye    == VIDEO_STEREO_OUTPUT_LEFT_ONLY &&
-                   libvlc_VideoStereoRightEye   == VIDEO_STEREO_OUTPUT_RIGHT_ONLY &&
-                   libvlc_VideoStereoSideBySide == VIDEO_STEREO_OUTPUT_SIDE_BY_SIDE,
+    static_assert( libvlc_VideoStereoAuto       == (int)VIDEO_STEREO_OUTPUT_AUTO &&
+                   libvlc_VideoStereoStereo     == (int)VIDEO_STEREO_OUTPUT_STEREO &&
+                   libvlc_VideoStereoLeftEye    == (int)VIDEO_STEREO_OUTPUT_LEFT_ONLY &&
+                   libvlc_VideoStereoRightEye   == (int)VIDEO_STEREO_OUTPUT_RIGHT_ONLY &&
+                   libvlc_VideoStereoSideBySide == (int)VIDEO_STEREO_OUTPUT_SIDE_BY_SIDE,
                    "stereo mode mismatch" );
 
     return var_GetInteger(p_mi, "video-stereo-mode");


=====================================
modules/access/dvdread.c
=====================================
@@ -79,7 +79,7 @@
 
 #ifdef DVDREAD_HAS_DVDAUDIO
 #define SET_AREA( p_demux, title, chapter, angle  ) \
-    (((type) == DVD_A ? DvdAudioReadSetArea : DvdReadSetArea)( p_demux, title, chapter, -1 ))
+    (((p_sys->type) == DVD_A ? DvdAudioReadSetArea : DvdReadSetArea)( p_demux, title, chapter, -1 ))
 #else
 #define SET_AREA( p_demux, title, chapter, angle ) \
     (DvdReadSetArea( p_demux, title, chapter, -1 ))
@@ -137,10 +137,10 @@ typedef struct
     int i_chapter, i_chapters;
     int cur_chapter;
     int i_angle, i_angles;
-    
+
     dvd_type_t type;
-    union 
-    { 
+    union
+    {
         /* Video tables */
         struct
         {
@@ -366,7 +366,7 @@ static int OpenCommon( vlc_object_t *p_this , dvd_type_t type )
 /*Call Backs*/
 static int Open( vlc_object_t *p_this )
 {
-    if( OpenCommon( p_this, DVD_V ) != VLC_SUCCESS ) 
+    if( OpenCommon( p_this, DVD_V ) != VLC_SUCCESS )
     {
         msg_Dbg( p_this, "Trying DVD-Audio as a fallback" );
         return OpenCommon( p_this, DVD_A );
@@ -443,7 +443,6 @@ static vlc_tick_t dvdtime_to_time( dvd_time_t *dtime )
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    dvd_type_t type = p_sys->type;
     double f, *pf;
     bool *pb;
     input_title_t ***ppp_title;
@@ -471,7 +470,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             f = va_arg( args, double );
 
 #ifdef DVDREAD_HAS_DVDAUDIO
-            if ( type == DVD_A )
+            if ( p_sys->type == DVD_A )
                 return DvdAudioReadSeek( p_demux, f * p_sys->i_title_blocks );
             else
 #endif
@@ -482,13 +481,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             {
                 vlc_tick_t length;
 #ifdef DVDREAD_HAS_DVDAUDIO
-                if (type == DVD_A )
+                if (p_sys->type == DVD_A )
                         length = FROM_SCALE_NZ( ( uint64_t ) p_sys->p_title_table->length_pts );
                 else
 #endif
                 length = dvdtime_to_time( &p_sys->p_cur_pgc->playback_time );
 
-                *va_arg( args, vlc_tick_t * ) = p_sys->i_title_offset * length 
+                *va_arg( args, vlc_tick_t * ) = p_sys->i_title_offset * length
                     / p_sys->i_title_blocks;
                 return VLC_SUCCESS;
             }
@@ -500,7 +499,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             {
                 vlc_tick_t length;
 #ifdef DVDREAD_HAS_DVDAUDIO
-                if ( type == DVD_A )
+                if ( p_sys->type == DVD_A )
                     length = FROM_SCALE_NZ( ( uint64_t ) p_sys->p_title_table->length_pts );
                 else
 #endif
@@ -1242,7 +1241,7 @@ static int DvdAudioReadSetArea( demux_t *p_demux, int i_title, int i_track,
          */
         msg_Dbg( p_demux, "open ATS %d, for group %d",
                  p_vmg->info_table_second_sector->tracks_info[i_title].group_property, i_title+ 1 );
-    
+
         /* Ifo ats */
         /* reusing p_vts variable for p_ats */
         if( p_sys->p_vts_file != NULL )
@@ -1275,9 +1274,9 @@ static int DvdAudioReadSetArea( demux_t *p_demux, int i_title, int i_track,
                  i_title, p_sys->i_ttn,
                  p_sys->i_title_start_block, p_sys->i_title_end_block,
                  p_sys->i_title_blocks );
-                 
+
         /* The structure of DVD-A discs seems to be the following
-         * each ATS IFO-> is a GROUP -> Contains multiple titles, Span across one or more AOBs -> each title contains multiple tracks or "Trackpoints", 
+         * each ATS IFO-> is a GROUP -> Contains multiple titles, Span across one or more AOBs -> each title contains multiple tracks or "Trackpoints",
          *
          * trackpoints are counted as tracks. They have records in the pointer table, and nr_pointer_records will include trackpoints. this is why it is different to nr_tracks*/
 
@@ -1339,7 +1338,7 @@ static int DvdAudioReadSetArea( demux_t *p_demux, int i_title, int i_track,
             - p_sys->p_title_table->atsi_track_pointer_rows[0].start_sector;
 
         msg_Dbg(p_demux, "Title Offset: %d", p_sys->i_title_offset);
-        
+
         p_sys->i_pack_len = 0;
         /* current block relative to start of title*/
         p_sys->i_cur_block=p_sys->p_title_table->atsi_track_pointer_rows[i_track].start_sector;
@@ -1680,14 +1679,13 @@ static void DemuxTitles( demux_t *p_demux, int *pi_angle )
     VLC_UNUSED( pi_angle );
 
     demux_sys_t *p_sys = p_demux->p_sys;
-    dvd_type_t type = p_sys->type;
     input_title_t *t;
     seekpoint_t *s;
 
     /* Find out number of titles/chapters */
     int32_t i_titles;
 #ifdef DVDREAD_HAS_DVDAUDIO
-    if ( type == DVD_A )
+    if ( p_sys->type == DVD_A )
         i_titles = p_sys->p_vmg_file->info_table_second_sector->nr_of_titles;
     else
 #endif
@@ -1703,7 +1701,7 @@ static void DemuxTitles( demux_t *p_demux, int *pi_angle )
         int j;
 
 #ifdef DVDREAD_HAS_DVDAUDIO
-        if ( type == DVD_A )
+        if ( p_sys->type == DVD_A )
             i_chapters = p_sys->p_vmg_file->info_table_second_sector->tracks_info[i].nr_chapters_in_title;
         else
 #endif
@@ -1714,7 +1712,7 @@ static void DemuxTitles( demux_t *p_demux, int *pi_angle )
         t = vlc_input_title_New();
 
 #ifdef DVDREAD_HAS_DVDAUDIO
-        if ( type == DVD_A )
+        if ( p_sys->type == DVD_A )
             t->i_length = FROM_SCALE_NZ( p_sys->p_vmg_file->
                                         info_table_second_sector->tracks_info[i].len_audio_zone_pts );
 #endif


=====================================
modules/codec/cc.c
=====================================
@@ -1121,7 +1121,7 @@ static void Eia608Strlcat( char *d, const char *s, int i_max )
         d[i_max-1] = '\0';
 }
 
-#define CAT(t) Eia608Strlcat( psz_text, t, i_text_max )
+#define CAT(t) Eia608Strlcat( psz_text, t, ARRAY_SIZE(psz_text) )
 
 static text_segment_t * Eia608TextLine( struct eia608_screen *screen, int i_row )
 {
@@ -1135,8 +1135,7 @@ static text_segment_t * Eia608TextLine( struct eia608_screen *screen, int i_row
     eia608_font_t prev_font = EIA608_FONT_REGULAR;
 
     char utf8[4];
-    const unsigned i_text_max = 4 * EIA608_SCREEN_COLUMNS + 1;
-    char psz_text[i_text_max + 1];
+    char psz_text[(4 * EIA608_SCREEN_COLUMNS + 1) + 1];
     psz_text[0] = '\0';
 
     /* Search the start */


=====================================
modules/codec/dvbsub.c
=====================================
@@ -1025,7 +1025,7 @@ static void alternative_CLUT( decoder_t *p_dec, bs_t *s, uint16_t i_segment_leng
     decoder_sys_t *p_sys = p_dec->p_sys;
     uint16_t      i_processed_length;
     int           i_id, i_version;
-    dvbsub_clut_t *p_clut, *p_next;
+    dvbsub_clut_t *p_clut;
 
     i_id = bs_read( s, 8 );
     i_version = bs_read( s, 4 );


=====================================
modules/codec/libass.c
=====================================
@@ -466,9 +466,8 @@ static void SubpictureUpdate( subpicture_t *p_subpic,
      * reinstanciate a lot the scaler, and as we do not support subpel blending
      * it looks ugly (text unaligned).
      */
-    const int i_max_region = 4;
-    rectangle_t region[i_max_region];
-    const int i_region = BuildRegions( region, i_max_region, p_img, p_fmt_dst->i_width, p_fmt_dst->i_height );
+    rectangle_t region[4];
+    const int i_region = BuildRegions( region, ARRAY_SIZE(region), p_img, p_fmt_dst->i_width, p_fmt_dst->i_height );
 
     if( i_region <= 0 )
     {


=====================================
modules/gui/macosx/playqueue/VLCPlaybackContinuityController.m
=====================================
@@ -161,7 +161,9 @@ static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList";
         return;
     }
 
-    const NSUInteger runtimeOption = [options indexOfObjectPassingTest:^BOOL(NSString * const obj, NSUInteger, BOOL *){
+    const NSUInteger runtimeOption = [options indexOfObjectPassingTest:^BOOL(NSString * const obj, NSUInteger i, BOOL *b){
+        VLC_UNUSED(i);
+        VLC_UNUSED(b);
         return [obj hasPrefix:@"start-time"] || [obj hasPrefix:@"stop-time"];
     }];
 


=====================================
modules/video_chroma/cvpx.c
=====================================
@@ -598,6 +598,7 @@ static picture_t *VideoBufferNew(filter_t *filter)
 
 static struct vlc_decoder_device *VideoHoldDevice(vlc_object_t *obj, void *sys)
 {
+    VLC_UNUSED(obj);
     filter_t *cvpx_chain = sys;
     return filter_HoldDecoderDevice(cvpx_chain);
 }


=====================================
modules/video_output/opengl/display.c
=====================================
@@ -174,6 +174,7 @@ static int SetDisplaySize(vout_display_t *vd, unsigned width, unsigned height)
 
 static int ChangeSourceProjection(vout_display_t *vd, video_projection_mode_t projection)
 {
+    VLC_UNUSED(projection);
     vout_display_sys_t *sys = vd->sys;
     PlacePicture(vd, &sys->place, vd->cfg->display);
     sys->restart_renderer = true;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/aee4cd3a97ba00abd67e72dc3603e06bf46ffb39...b8f5485eac9e29da447542b243a24f1805586941

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/aee4cd3a97ba00abd67e72dc3603e06bf46ffb39...b8f5485eac9e29da447542b243a24f1805586941
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