Sebastian Dröge 18798440e3 videotimecode: Fix conversion of timecode to datetime with drop-frame timecodes
gst_video_time_code_to_date_time() simply calculated the date time based on
adding the hours/minutes/seconds to the daily jam. This causes a gap every full
minute (except for every 10th minute) with drop-frame timecodes as the first 2
(29.97fps) or 4 (59.94fps) timecodes are skipped (not frames!), e.g. with
29.97fps:

timecode: 12:00:59;28  12:00:59;29  12:01:00;02  12:01:00;03
time    : 12:00:59.950 12:00:59.983 12:01:00.017 12:01:00.050

and not

time    : 12:00:59.934 12:00:59.968 12:01:00.067 12:01:00.100
                        |-- gap of 2 frames --|

The correct calculation would be to use gst_video_time_code_nsec_since_daily_jam()
and add that to the daily jam.

Also add a test for this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8649>
2025-03-26 09:32:36 +02:00
..