[vlc-commits] [Git][videolan/vlc][master] 2 commits: core: stats: use unsigned

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Dec 7 14:07:24 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
2c04608b by Thomas Guillem at 2023-12-07T13:47:27+00:00
core: stats: use unsigned

This struct is filled from from unsigned values: uintmax_t.

- - - - -
d2f9c6cd by Thomas Guillem at 2023-12-07T13:47:27+00:00
lib: media: use uint64_t for stats

Core stats use uint64_t. This fixes int overflow (specially on
i_read_bytes, when reading more than 2GB).

- - - - -


2 changed files:

- include/vlc/libvlc_media.h
- include/vlc_input_item.h


Changes:

=====================================
include/vlc/libvlc_media.h
=====================================
@@ -103,27 +103,27 @@ enum
 typedef struct libvlc_media_stats_t
 {
     /* Input */
-    int         i_read_bytes;
+    uint64_t     i_read_bytes;
     float       f_input_bitrate;
 
     /* Demux */
-    int         i_demux_read_bytes;
+    uint64_t     i_demux_read_bytes;
     float       f_demux_bitrate;
-    int         i_demux_corrupted;
-    int         i_demux_discontinuity;
+    uint64_t     i_demux_corrupted;
+    uint64_t     i_demux_discontinuity;
 
     /* Decoders */
-    int         i_decoded_video;
-    int         i_decoded_audio;
+    uint64_t     i_decoded_video;
+    uint64_t     i_decoded_audio;
 
     /* Video Output */
-    int         i_displayed_pictures;
-    int         i_late_pictures;
-    int         i_lost_pictures;
+    uint64_t     i_displayed_pictures;
+    uint64_t     i_late_pictures;
+    uint64_t     i_lost_pictures;
 
     /* Audio output */
-    int         i_played_abuffers;
-    int         i_lost_abuffers;
+    uint64_t     i_played_abuffers;
+    uint64_t     i_lost_abuffers;
 } libvlc_media_stats_t;
 
 /**


=====================================
include/vlc_input_item.h
=====================================
@@ -528,29 +528,29 @@ VLC_API void libvlc_MetadataCancel( libvlc_int_t *, void * );
 struct input_stats_t
 {
     /* Input */
-    int64_t i_read_packets;
-    int64_t i_read_bytes;
+    uint64_t i_read_packets;
+    uint64_t i_read_bytes;
     float f_input_bitrate;
 
     /* Demux */
-    int64_t i_demux_read_packets;
-    int64_t i_demux_read_bytes;
+    uint64_t i_demux_read_packets;
+    uint64_t i_demux_read_bytes;
     float f_demux_bitrate;
-    int64_t i_demux_corrupted;
-    int64_t i_demux_discontinuity;
+    uint64_t i_demux_corrupted;
+    uint64_t i_demux_discontinuity;
 
     /* Decoders */
-    int64_t i_decoded_audio;
-    int64_t i_decoded_video;
+    uint64_t i_decoded_audio;
+    uint64_t i_decoded_video;
 
     /* Vout */
-    int64_t i_displayed_pictures;
-    int64_t i_late_pictures;
-    int64_t i_lost_pictures;
+    uint64_t i_displayed_pictures;
+    uint64_t i_late_pictures;
+    uint64_t i_lost_pictures;
 
     /* Aout */
-    int64_t i_played_abuffers;
-    int64_t i_lost_abuffers;
+    uint64_t i_played_abuffers;
+    uint64_t i_lost_abuffers;
 };
 
 /**



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a6f0f6762c0234939ac24a2f3dcf3f32d693ad6a...d2f9c6cd93e9c41bdf9cb1ecdd0876ed3c16946f

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