[vlc-commits] [Git][videolan/vlc][master] 10 commits: png: fix ORIENT_TO_EXIF printing

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Oct 20 11:28:26 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
574c50dc by Steve Lhomme at 2023-10-20T11:07:58+00:00
png: fix ORIENT_TO_EXIF printing

PRIu8 is probably OK but it needs a uint8_t value.

- - - - -
b48cb189 by Steve Lhomme at 2023-10-20T11:07:58+00:00
config: cast getpid to a uint32_t for temporary file

It depends on the size of pid_t on each system. This is how it's used in
cache.c and fsstorage.c.

- - - - -
72843f16 by Steve Lhomme at 2023-10-20T11:07:58+00:00
vlc_network: map gai_strerror to the ANSI version on all Windows UNICODE builds

It doesn't depend on the WINAPI family. VLC expects it to return char*.

- - - - -
6a666ccc by Steve Lhomme at 2023-10-20T11:07:58+00:00
test: libvlc/media: avoid potential sprintf overflow

If the track count tested grows, the local string will not be able to hold
bigger values.

- - - - -
90f7049d by Steve Lhomme at 2023-10-20T11:07:58+00:00
test: input_decoder: allow full range of CC channels in strings

- - - - -
accf09bc by Steve Lhomme at 2023-10-20T11:07:58+00:00
udisks: fix asprintf format for uint64_t

- - - - -
febf2b6e by Steve Lhomme at 2023-10-20T11:07:58+00:00
coreaudio: fix debug formatting

- - - - -
c7844c8d by Steve Lhomme at 2023-10-20T11:07:58+00:00
macOS: fix OSStatus display

Fixes this warning:
> values of type 'OSStatus' should not be used as format arguments; add an
> explicit cast to 'int' instead

- - - - -
cf9be009 by Steve Lhomme at 2023-10-20T11:07:58+00:00
codec: videotoolbox: remove extra white spaces

- - - - -
a1f42f8b by Steve Lhomme at 2023-10-20T11:07:58+00:00
actions: match the format string with the buffer size

- - - - -


11 changed files:

- include/vlc_network.h
- modules/audio_output/coreaudio_common.c
- modules/codec/audiotoolbox_midi.c
- modules/codec/png.c
- modules/codec/videotoolbox/decoder.c
- modules/keystore/keychain.m
- modules/services_discovery/udisks.c
- src/config/file.c
- src/misc/actions.c
- test/libvlc/media.c
- test/src/input/decoder/input_decoder_scenarios.c


Changes:

=====================================
include/vlc_network.h
=====================================
@@ -286,7 +286,7 @@ static inline int vlc_setsockopt(int s, int level, int name,
 #endif
 
 #ifdef _WIN32
-# if !defined(WINAPI_FAMILY) || WINAPI_FAMILY != WINAPI_FAMILY_APP
+# if defined(UNICODE)
 #  undef gai_strerror
 #  define gai_strerror gai_strerrorA
 # endif


=====================================
modules/audio_output/coreaudio_common.c
=====================================
@@ -618,8 +618,8 @@ MapOutputLayout(audio_output_t *p_aout, audio_sample_format_t *fmt,
     {
         assert(outlayout->mNumberChannelDescriptions > 0);
 
-        msg_Dbg(p_aout, "output layout of AUHAL has %i channels",
-                outlayout->mNumberChannelDescriptions);
+        msg_Dbg(p_aout, "output layout of AUHAL has %d channels",
+                (int) outlayout->mNumberChannelDescriptions);
         uint32_t chans_out[AOUT_CHAN_MAX];
 
         /* For 7.1, AOUT_CHAN_MIDDLELEFT/RIGHT needs to be swapped with
@@ -660,7 +660,7 @@ MapOutputLayout(audio_output_t *p_aout, audio_sample_format_t *fmt,
             {
                 chans_out[i] = 0;
                 msg_Dbg(p_aout, "found nonrecognized channel %d at index "
-                        "%d", chan, i);
+                        "%u", (int) chan, i);
             }
         }
         if (fmt->i_physical_channels == 0)


=====================================
modules/codec/audiotoolbox_midi.c
=====================================
@@ -181,7 +181,7 @@ static int SetSoundfont(decoder_t *p_dec, AudioUnit synthUnit, const char *sfPat
     CFRelease(url);
 
     if (status != noErr) {
-        msg_Err(p_dec, "failed setting custom SoundFont for MIDI synthesis (%i)", status);
+        msg_Err(p_dec, "failed setting custom SoundFont for MIDI synthesis (%i)", (int)status);
         return VLC_EGENERIC;
     }
     return VLC_SUCCESS;
@@ -203,7 +203,7 @@ static int Open(vlc_object_t *p_this)
     p_sys->graph = NULL;
     status = CreateAUGraph(&p_sys->graph, &p_sys->synthUnit, &p_sys->outputUnit);
     if (unlikely(status != noErr)) {
-        msg_Err(p_dec, "failed to create audiograph (%i)", status);
+        msg_Err(p_dec, "failed to create audiograph (%i)", (int)status);
         ret = VLC_EGENERIC;
         goto bailout;
     }
@@ -245,7 +245,7 @@ static int Open(vlc_object_t *p_this)
                                   kAudioUnitScope_Output, 0, &ASBD,
                                   sizeof(AudioStreamBasicDescription));
     if (unlikely(status != noErr)) {
-        msg_Err(p_dec, "failed setting output format for output unit (%i)", status);
+        msg_Err(p_dec, "failed setting output format for output unit (%i)", (int)status);
         ret = VLC_EGENERIC;
         goto bailout;
     }
@@ -256,7 +256,7 @@ static int Open(vlc_object_t *p_this)
         if (status == kAudioUnitErr_InvalidFile)
             msg_Err(p_dec, "failed initializing audiograph: invalid soundfont file");
         else
-            msg_Err(p_dec, "failed initializing audiograph (%i)", status);
+            msg_Err(p_dec, "failed initializing audiograph (%i)", (int)status);
         ret = VLC_EGENERIC;
         goto bailout;
     }
@@ -269,7 +269,7 @@ static int Open(vlc_object_t *p_this)
     // Start the AU
     status = AUGraphStart(p_sys->graph);
     if (unlikely(status != noErr)) {
-        msg_Err(p_dec, "failed starting audiograph (%i)", status);
+        msg_Err(p_dec, "failed starting audiograph (%i)", (int)status);
         ret = VLC_EGENERIC;
         goto bailout;
     }
@@ -405,7 +405,7 @@ static int DecodeBlock (decoder_t *p_dec, block_t *p_block)
                              frames, &bufferList);
 
     if (status != noErr) {
-        msg_Warn(p_dec, "rendering audio unit failed: %i", status);
+        msg_Warn(p_dec, "rendering audio unit failed: %i", (int)status);
         block_Release(p_out);
         p_out = NULL;
     }


=====================================
modules/codec/png.c
=====================================
@@ -221,7 +221,7 @@ static int make_xmp_packet( const video_format_t *fmt, png_textp chunk )
                "</rdf:Description>"
               "</rdf:RDF>"
              "</x:xmpmeta>"
-            "<?xpacket end='r'?>", id, ORIENT_TO_EXIF(fmt->orientation) );
+            "<?xpacket end='r'?>", id, (uint8_t)ORIENT_TO_EXIF(fmt->orientation) );
     if(len == 0)
     {
         free(chunk->text);


=====================================
modules/codec/videotoolbox/decoder.c
=====================================
@@ -1179,11 +1179,11 @@ static CMVideoCodecType CodecPrecheck(decoder_t *p_dec)
     vlc_assert_unreachable();
 }
 
-static void 
-SetDecoderColorProperties(CFMutableDictionaryRef decoderConfiguration, 
+static void
+SetDecoderColorProperties(CFMutableDictionaryRef decoderConfiguration,
                           const video_format_t *video_fmt)
 {
-    /** 
+    /**
      VideoToolbox decoder doesn't attach all color properties to image buffers.
      Current display modules handle tonemap without them.
      Attaching additional color properties to image buffers is mandatory for
@@ -1191,8 +1191,8 @@ SetDecoderColorProperties(CFMutableDictionaryRef decoderConfiguration,
      tonemap when AVFoundation APIs are used to render them and prevent
      flickering while using multiple displays with different colorsync profiles.
     */
-    
-    CFStringRef color_matrix = 
+
+    CFStringRef color_matrix =
         cvpx_map_YCbCrMatrix_from_vcs(video_fmt->space);
     if (color_matrix) {
         CFDictionarySetValue(
@@ -1201,22 +1201,22 @@ SetDecoderColorProperties(CFMutableDictionaryRef decoderConfiguration,
             color_matrix);
     }
 
-    CFStringRef color_primaries = 
+    CFStringRef color_primaries =
         cvpx_map_ColorPrimaries_from_vcp(video_fmt->primaries);
     if (color_primaries) {
         CFDictionarySetValue(
-            decoderConfiguration, 
-            kCVImageBufferColorPrimariesKey, 
+            decoderConfiguration,
+            kCVImageBufferColorPrimariesKey,
             color_primaries
         );
     }
 
-    CFStringRef color_transfer_func = 
+    CFStringRef color_transfer_func =
         cvpx_map_TransferFunction_from_vtf(video_fmt->transfer);
     if (color_transfer_func) {
         CFDictionarySetValue(
-            decoderConfiguration, 
-            kCVImageBufferTransferFunctionKey, 
+            decoderConfiguration,
+            kCVImageBufferTransferFunctionKey,
             color_transfer_func
         );
     }
@@ -2163,7 +2163,7 @@ static int DecodeBlock(decoder_t *p_dec, block_t *p_block)
     }
     else
     {
-        msg_Dbg(p_dec, "session rejected frame %"PRId64" with status %d", p_info->pts, status);
+        msg_Dbg(p_dec, "session rejected frame %"PRId64" with status %d", p_info->pts, (int)status);
         p_sys->sync_state = p_sys->start_sync_state;
         vlc_mutex_lock(&p_sys->lock);
         p_sys->vtsession_status = vtsession_status;


=====================================
modules/keystore/keychain.m
=====================================
@@ -456,7 +456,7 @@ static unsigned int Find(vlc_keystore *p_keystore,
 
     status = SecItemCopyMatching((__bridge CFDictionaryRef)searchQuery, &result);
     if (status != errSecSuccess) {
-        msg_Warn(p_keystore, "lookup failed (%i: '%s')", status, [ErrorForStatus(status) UTF8String]);
+        msg_Warn(p_keystore, "lookup failed (%i: '%s')", (int)status, [ErrorForStatus(status) UTF8String]);
         return 0;
     }
 


=====================================
modules/services_discovery/udisks.c
=====================================
@@ -126,7 +126,7 @@ static input_item_t *input_item_NewDrive(const char *drive_label, const char *pa
         return NULL;
 
     int prefix = human(&size);
-    r = asprintf(&label, "%s (%ld %s)", print_label(drive_label, removable), size, vlc_gettext(binary_prefixes[prefix]));
+    r = asprintf(&label, "%s (%" PRIu64 " %s)", print_label(drive_label, removable), size, vlc_gettext(binary_prefixes[prefix]));
     if(r == -1)
     {
         free(uri);


=====================================
src/config/file.c
=====================================
@@ -367,7 +367,7 @@ int (config_SaveConfigFile) (libvlc_int_t *p_this)
     char *permanent = config_GetConfigFile (p_this);
     if (permanent == NULL)
         return -1;
-    if (asprintf (&temporary, "%s.%u", permanent, getpid ()) == -1)
+    if (asprintf (&temporary, "%s.%"PRIu32, permanent, (uint32_t)getpid ()) == -1)
     {
         free (permanent);
         return -1;


=====================================
src/misc/actions.c
=====================================
@@ -554,9 +554,11 @@ int libvlc_InternalActionsInit (libvlc_int_t *libvlc)
 #endif
         as->ppsz_keys[i] = s_names2actions[i].psz;
 
+#define STRINGIFY_(x) #x
+#define STRINGIFY(x) STRINGIFY_(x)
         char name[12 + MAXACTION];
 
-        snprintf (name, sizeof (name), "global-key-%s", s_names2actions[i].psz);
+        snprintf (name, sizeof (name), "global-key-%." STRINGIFY(MAXACTION) "s", s_names2actions[i].psz);
         init_action (obj, &as->map, name + 7, s_names2actions[i].id);
         init_action (obj, &as->global_map, name, s_names2actions[i].id);
     }


=====================================
test/libvlc/media.c
=====================================
@@ -163,6 +163,7 @@ static void test_media_tracks(libvlc_instance_t *vlc)
                                  libvlc_media_parse_local|libvlc_media_parse_forced,
                                  libvlc_media_parsed_status_done);
 
+    char buf[32];
     libvlc_media_tracklist_t *tracklist;
 
     tracklist = libvlc_media_get_tracklist(media, libvlc_track_video);
@@ -176,7 +177,6 @@ static void test_media_tracks(libvlc_instance_t *vlc)
         assert(track->video->i_width == 100);
         assert(track->video->i_height == 50);
 
-        char buf[] = "video/4";
         sprintf(buf, "video/%zu", i);
         assert(strcmp(track->psz_id, buf) == 0);
         assert(track->id_stable);
@@ -194,7 +194,6 @@ static void test_media_tracks(libvlc_instance_t *vlc)
         assert(track->audio->i_channels == 2);
         assert(track->audio->i_rate == 48000);
 
-        char buf[] = "audio/42";
         sprintf(buf, "audio/%zu", i);
         assert(strcmp(track->psz_id, buf) == 0);
         assert(track->id_stable);


=====================================
test/src/input/decoder/input_decoder_scenarios.c
=====================================
@@ -536,7 +536,7 @@ static void cc_decoder_setup_708_1064(decoder_t *dec)
 
 static int cc_decoder_decode_channel(decoder_t *dec, vlc_frame_t *in)
 {
-    char buf[] = "ccxx_dec";
+    char buf[] = "ccxxx_dec";
     assert(dec->fmt_in->subs.cc.i_channel < 64);
     sprintf(buf, "cc%02u_dec", dec->fmt_in->subs.cc.i_channel + 1);
     return cc_decoder_decode_common(dec, in, buf);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bc51b8f9f511e6f88ad0946fa5bf914d883be373...a1f42f8bdb04bd6b32413225009a13f2c594ddee

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