[vlc-commits] [Git][videolan/vlc][master] demux: mpeg: ensure FROM_SCALE_NZ/TO_SCALE_NZ are in sync with CLOCK_FREQ

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 22 08:49:53 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
66e01fd1 by Steve Lhomme at 2025-08-22T08:33:16+00:00
demux: mpeg: ensure FROM_SCALE_NZ/TO_SCALE_NZ are in sync with CLOCK_FREQ

If CLOCK_FREQ changes these macros are not correct anymore.

- - - - -


1 changed file:

- modules/demux/mpeg/timestamps.h


Changes:

=====================================
modules/demux/mpeg/timestamps.h
=====================================
@@ -19,6 +19,10 @@
 #ifndef VLC_MPEG_TIMESTAMPS_H
 #define VLC_MPEG_TIMESTAMPS_H
 
+#ifndef __cplusplus
+_Static_assert(CLOCK_FREQ == 1000000, "FROM|TO_SCALE_NZ not matching CLOCK_FREQ");
+#endif
+
 #define FROM_SCALE_NZ(x) (((vlc_tick_t)(x) * 100 / 9))
 #define TO_SCALE_NZ(x)   ((x) * 9 / 100)
 



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/66e01fd135f227c93731ad108c24bc4b47ddac26
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