ffmpeg-bb/tests/fate
Martin Storsjö 26da3d0069 fate: Fix the sub-mcc tests on Windows in eastern time zones
Previously, these tests failed when running on Windows, if the
system is configured with a time zone east of Greenwich, i.e.
with a positive GMT offset.

The muxer converts the creation_date given by the user using
av_parse_time to unix time, as a time_t. The creation_date is
interpreted as a local time, i.e. according to the current time
zone. (This time_t value is then converted back to a broken out
local time form with localtime_r.)

The given reference date/time, "1970-01-01T00:00:00", is the
origin point for unix time, corresponding to time_t zero. However
when interpreted as local time, this doesn't map to exactly zero.
Time zones east of Greenwich reached this time a number of hours
before the point of zero time_t - so the corresponding time_t
value essentially is minus the GMT offset, in seconds.

Windows mktime returns an error, returning (time_t)-1, when given
such a "struct tm", while e.g. glibc mktime happily returns a
negative time_t. av_parse_time doesn't check the return value of
mktime for potential errors.

This is observable with the following test snippet:

    struct tm tm = { 0 };
    tm.tm_year = 70;
    tm.tm_isdst = -1;
    tm.tm_mday = 1;
    tm.tm_hour = 0;
    time_t t = mktime(&tm);
    printf("%d-%02d-%02d %02d:%02d:%02d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
    printf("t %d\n", (int)t);

By varying the value of tm_hour and the system time zone, one
can observe that Windows mktime returns -1 for all time_t values
that would have been negative.

This range limit is also documented by Microsoft in detail at
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64.

To avoid the issue, pick a different, arbitrary reference time,
which should have a nonnegative time_t for all time zones.

(cherry picked from commit 13139d6d83e8bdcf8a2c81af14ed2c3e30b5e1c1)
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-08-12 13:45:57 +03:00
..
aac.mak fate/all: fix missing some mov demuxer dependencies 2025-07-05 21:10:49 +02:00
ac3.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
acodec.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
adpcm.mak tests/fate/audio: Sanyo LD-ADPCM test case 2025-08-04 08:01:24 +00:00
alac.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
als.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
amrnb.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
amrwb.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
api.mak fate/all: fix multiple dependencies 2025-07-05 21:10:48 +02:00
apng.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
apv.mak fate: Add test for APV 400-10 profile 2025-05-13 19:38:08 +01:00
atrac.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
audio.mak tests/fate/audio: G.728 test case 2025-08-04 08:01:24 +00:00
bmp.mak fate/bmp: Fix test requirements 2022-04-28 02:39:37 +02:00
build.mak Merge commit 'db869f4ea4405fb8f9736e5ecdca70f77621a28e' 2017-10-11 19:02:04 -03:00
caf.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
canopus.mak fate/canopus: Fix test requirements 2022-05-03 04:18:05 +02:00
cbs.mak fate/all: add missing file protocol dependencies 2025-07-05 21:10:49 +02:00
cdxl.mak fate/cdxl: Fix test requirements 2022-04-28 02:39:37 +02:00
checkasm.mak tests/checkasm: add check for vf_colordetect 2025-07-21 18:10:26 +02:00
concatdec.mak fate/all: add missing dependencies for extradata bsf 2025-07-05 21:10:43 +02:00
cover-art.mak fate/all: add missing file protocol dependencies 2025-07-05 21:10:49 +02:00
dca.mak tests/dca: remove usage of deprecated request_channel_layout option 2023-12-28 15:31:50 -03:00
demux.mak tests/fate/demux: IFF ANIM test case 2025-08-04 08:01:24 +00:00
dfa.mak fate/dfa: Fix test requirements 2022-04-28 02:39:37 +02:00
dnxhd.mak fate/dnxhd: Fix test requirements 2022-05-03 04:18:05 +02:00
dpcm.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
dvvideo.mak lavc/dvdec: export bitrate 2023-07-07 12:12:52 +02:00
ea.mak fate/ea: Fix test requirements 2022-05-03 04:18:05 +02:00
enc_external.mak fate/all: switch-fix mov muxer dependency to mp4 muxer dependency 2025-07-05 21:10:44 +02:00
exif.mak fate: add WebP Exif metadata test 2014-01-15 21:20:47 +01:00
ffmpeg.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
ffprobe.mak all: fix whitespace/new-line issues 2025-08-03 13:48:47 +02:00
fifo-muxer.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
filter-audio.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
filter-video.mak fate: Add a missing ffprobe dependency for fate-filter-select-ffprobe 2025-07-30 19:33:30 +00:00
fits.mak fate/all: fix multiple dependencies 2025-07-05 21:10:48 +02:00
flac.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
flvenc.mak fate/all: add missing dependencies for extradata bsf 2025-07-05 21:10:43 +02:00
gapless.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
gif.mak fate/all: fix multiple dependencies 2025-07-05 21:10:48 +02:00
h264.mak all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
hap.mak fate/hap: Fix test requirements 2022-05-03 04:18:06 +02:00
hevc.mak fate/hevc: fix multiple dependencies 2025-07-05 21:10:48 +02:00
hlsenc.mak tests/fate/hlsenc: add testcase of hls fragment mp4 named cmfa 2025-08-05 11:47:11 +00:00
hw.mak tests: Add EXESUF to program calls. 2019-04-19 01:11:39 +02:00
iamf.mak tests/iamf: rename BACK to SIDE filterchain labels in the 5.1.4 iamf tests 2025-06-24 14:41:43 -03:00
id3v2.mak fate/id3v2: Add test for reading and writing UTF-16 BOM tags 2022-09-12 22:26:27 +02:00
image.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
imf.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
indeo.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
jpeg2000.mak fate/jpeg2000dec: add support for p0_10.j2k 2024-06-24 08:50:59 -07:00
jxl.mak fate/jpegxl: add multiframe permuted TOC image parser test 2023-12-15 11:52:43 -05:00
lavf-audio.mak all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
lavf-container.mak fate/lavf-container: add test for APV in MP4 2025-07-18 14:55:34 -03:00
lavf-image.mak Revert "tests/fate: disable compression for zlib-based codecs" 2024-10-16 17:38:57 -03:00
lavf-image2pipe.mak fate: add QOI/XBM/XWD image2pipe tests 2022-12-03 19:38:11 +01:00
lavf-video.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
libavcodec.mak configure: add celp_math component 2025-06-17 16:39:36 +10:00
libavdevice.mak tests: Move all test programs to a subdirectory 2016-05-13 14:55:56 +02:00
libavformat.mak fate/all: fix multiple dependencies 2025-07-05 21:10:48 +02:00
libavutil.mak avutil/frame: add helper for adding side data to array 2024-03-20 19:14:02 +02:00
libswresample.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
libswscale.mak fate/libswscale: Disable ffmpeg-dependent tests without ffmpeg 2024-04-03 19:10:23 +02:00
lossless-audio.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
lossless-video.mak tests/fate: replace deprecated -vsync with -fps_mode 2023-11-14 18:18:26 +01:00
matroska.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
microsoft.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
monkeysaudio.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
mov.mak tests/fate/mov: add a test muxing multiple stsd entries 2025-07-30 16:48:14 -03:00
mp3.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
mpc.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
mpeg4.mak fate/mpeg4: fix multiple dependencies 2025-07-05 21:10:47 +02:00
mpegps.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
mpegts.mak tests/Makefile: Make DEMDEC etc. auxiliary functions more flexible 2022-04-28 02:39:37 +02:00
mxf.mak fftools/ffprobe: Make pix_fmt output bitexact 2025-03-30 08:24:39 +02:00
ogg-flac.mak fate/all: fix multiple dependencies 2025-07-05 21:10:48 +02:00
ogg-opus.mak tests: Add stream dump test API util, use it to dump stream data for chained ogg/{vorbis, opus, flac} streams. 2025-04-30 00:03:00 +02:00
ogg-vorbis.mak tests: Add stream dump test API util, use it to dump stream data for chained ogg/{vorbis, opus, flac} streams. 2025-04-30 00:03:00 +02:00
oma.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
opus.mak fate/opus: add silk LBRR test (refs #9890) 2022-10-04 11:54:57 +02:00
pcm.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
pixfmt.mak fate/all: add missing file protocol dependencies 2025-07-05 21:10:49 +02:00
pixlet.mak fate/pixlet: Fix test requirements 2022-05-03 04:18:06 +02:00
probe.mak tests/fate/probe: add test for dts in wav 2025-05-16 20:43:58 +02:00
prores.mak fate/prores: Fix test requirements 2022-05-03 04:18:06 +02:00
qoa.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
qt.mak tests/fate/qt: Use passthrough fps_mode for svq3-watermark 2025-05-21 03:10:52 +02:00
qtrle.mak fate/qtrle: Fix test requirements 2022-05-03 04:18:06 +02:00
real.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
screen.mak tests/fate/screen: Add test for skipping cursor with FIC 2025-07-03 19:42:28 +02:00
seek.mak fate/seek: fix missing mpeg4video parser dependency 2025-07-05 21:10:50 +02:00
segafilm.mak fate/segafilm: Add tests for segafilm (de)muxer 2022-09-20 18:32:28 +02:00
segment.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
source-check.sh tests/fate/source-check: Relax BSD licence check 2024-05-27 19:04:09 +02:00
source.mak fate: Add basic license header check 2015-09-29 18:52:35 +02:00
spdif.mak all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
speedhq.mak fate/speedhq: Fix test requirements 2022-04-28 02:39:37 +02:00
subtitles.mak fate: Fix the sub-mcc tests on Windows in eastern time zones 2025-08-12 13:45:57 +03:00
truehd.mak tests/truehd: remove usage of deprecated request_channel_layout option 2023-12-28 15:31:36 -03:00
utvideo.mak fate/utvideo: Fix test requirements 2022-04-28 02:39:37 +02:00
vbn.mak fate/vbn, tests/fate-run: Delete intermediate VBN-files after tests 2022-05-03 04:18:05 +02:00
vcodec.mak fate/all: fix multiple dependencies 2025-07-05 21:10:48 +02:00
video.mak tests/fate/video: LEAD MCMP test case 2025-08-04 08:01:24 +00:00
voice.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
vorbis.mak fate/vorbis: fix multiple dependencies 2025-07-05 21:10:45 +02:00
vpx.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
vqf.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
vvc.mak fate/vvc: add vvc-conformance-FIELD_A_4 2025-08-08 16:55:12 +00:00
wavpack.mak fate/all: add missing file protocol dependencies 2025-07-05 21:10:49 +02:00
webm-dash-manifest.mak fate/vpx: Move webm-dash-manifest tests to a new file 2022-05-03 04:18:06 +02:00
wma.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00
xvid.mak fate/all: add missing crc/framecrc/md5/framemd5/pipe dependencies 2025-07-05 21:10:49 +02:00