The branch, release/8.0 has been updated
       via  26da3d00696a735242c25c789e3deeb7d8232cdd (commit)
      from  a8fdfddedb1ec1167378e9306e73864f5de23c72 (commit)


- Log -----------------------------------------------------------------
commit 26da3d00696a735242c25c789e3deeb7d8232cdd
Author:     Martin Storsjö <mar...@martin.st>
AuthorDate: Mon Aug 11 14:26:44 2025 +0300
Commit:     Martin Storsjö <mar...@martin.st>
CommitDate: Tue Aug 12 13:45:57 2025 +0300

    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ö <mar...@martin.st>

diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 56eefa3b88..8423e8311a 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -131,24 +131,24 @@ fate-sub-rcwt: CMP = oneline
 fate-sub-rcwt: REF = d86f179094a5752d68aa97d82cf887b0
 
 FATE_SUBTITLES-$(call ALLYES, AVDEVICE LAVFI_INDEV MOVIE_FILTER MPEGTS_DEMUXER 
MCC_MUXER EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc
-fate-sub-mcc: CMD = md5 -f lavfi -i 
"movie=$(TARGET_SAMPLES)/sub/scte20.ts[out0+subcc]" -map 0:s -c copy 
-override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00" -bitexact -f 
mcc
+fate-sub-mcc: CMD = md5 -f lavfi -i 
"movie=$(TARGET_SAMPLES)/sub/scte20.ts[out0+subcc]" -map 0:s -c copy 
-override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00" -bitexact -f 
mcc
 fate-sub-mcc: CMP = oneline
-fate-sub-mcc: REF = 752c60c3a74445a2a76e1a6465064763
+fate-sub-mcc: REF = 779ca7759324441febd6aa6039f29308
 
 FATE_SUBTITLES-$(call DEMMUX, MCC, MCC, SMPTE436M_TO_EIA608_BSF 
EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc-remux-eia608-bsf
-fate-sub-mcc-remux-eia608-bsf: CMD = fmtstdout mcc -f mcc -i 
$(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:s -c copy -bsf 
"eia608_to_smpte436m=cdp_frame_rate=60000/1001:initial_cdp_sequence_cntr=65535:line_number=11"
 -override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00"
+fate-sub-mcc-remux-eia608-bsf: CMD = fmtstdout mcc -f mcc -i 
$(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:s -c copy -bsf 
"eia608_to_smpte436m=cdp_frame_rate=60000/1001:initial_cdp_sequence_cntr=65535:line_number=11"
 -override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
 fate-sub-mcc-remux-eia608-bsf: CMP = rawdiff
 
 FATE_SUBTITLES-$(call DEMMUX, MCC, MCC, SMPTE436M_TO_EIA608_BSF 
EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc-remux-eia608
-fate-sub-mcc-remux-eia608: CMD = fmtstdout mcc -f mcc -i 
$(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:s -c copy 
-override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00"
+fate-sub-mcc-remux-eia608: CMD = fmtstdout mcc -f mcc -i 
$(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:s -c copy 
-override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
 fate-sub-mcc-remux-eia608: CMP = rawdiff
 
 FATE_SUBTITLES-$(call DEMMUX, MCC, MCC, SMPTE436M_TO_EIA608_BSF 
EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc-remux-eia608-recode
-fate-sub-mcc-remux-eia608-recode: CMD = fmtstdout mcc -eia608_extract 0 -f mcc 
-i $(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:d -c copy -bsf 
smpte436m_to_eia608 -override_time_code_rate ntsc -creation_time 
"1970-01-01T00:00:00"
+fate-sub-mcc-remux-eia608-recode: CMD = fmtstdout mcc -eia608_extract 0 -f mcc 
-i $(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:d -c copy -bsf 
smpte436m_to_eia608 -override_time_code_rate ntsc -creation_time 
"1970-01-02T00:00:00"
 fate-sub-mcc-remux-eia608-recode: CMP = rawdiff
 
 FATE_SUBTITLES-$(call DEMMUX, MCC, MCC) += fate-sub-mcc-remux
-fate-sub-mcc-remux: CMD = fmtstdout mcc -eia608_extract 0 -f mcc -i 
$(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:d -c copy 
-override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00"
+fate-sub-mcc-remux: CMD = fmtstdout mcc -eia608_extract 0 -f mcc -i 
$(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:d -c copy 
-override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
 fate-sub-mcc-remux: CMP = rawdiff
 
 FATE_SUBTITLES-$(call FRAMECRC, MPEGTS, DVBSUB, DVBSUB_ENCODER) += fate-sub-dvb
diff --git a/tests/ref/fate/sub-mcc-remux b/tests/ref/fate/sub-mcc-remux
index d9d2f32dc0..a58c040711 100644
--- a/tests/ref/fate/sub-mcc-remux
+++ b/tests/ref/fate/sub-mcc-remux
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
 
 UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
 Creation Program=FFmpeg
-Creation Date=Thursday, January 1, 1970
+Creation Date=Friday, January 2, 1970
 Creation Time=00:00:00
 Time Code Rate=30DF
 
diff --git a/tests/ref/fate/sub-mcc-remux-eia608 
b/tests/ref/fate/sub-mcc-remux-eia608
index 01e8c37b2c..f31562d524 100644
--- a/tests/ref/fate/sub-mcc-remux-eia608
+++ b/tests/ref/fate/sub-mcc-remux-eia608
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
 
 UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
 Creation Program=FFmpeg
-Creation Date=Thursday, January 1, 1970
+Creation Date=Friday, January 2, 1970
 Creation Time=00:00:00
 Time Code Rate=30DF
 
diff --git a/tests/ref/fate/sub-mcc-remux-eia608-bsf 
b/tests/ref/fate/sub-mcc-remux-eia608-bsf
index 64e428f6f1..c0e125db5e 100644
--- a/tests/ref/fate/sub-mcc-remux-eia608-bsf
+++ b/tests/ref/fate/sub-mcc-remux-eia608-bsf
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
 
 UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
 Creation Program=FFmpeg
-Creation Date=Thursday, January 1, 1970
+Creation Date=Friday, January 2, 1970
 Creation Time=00:00:00
 Time Code Rate=30DF
 
diff --git a/tests/ref/fate/sub-mcc-remux-eia608-recode 
b/tests/ref/fate/sub-mcc-remux-eia608-recode
index 01e8c37b2c..f31562d524 100644
--- a/tests/ref/fate/sub-mcc-remux-eia608-recode
+++ b/tests/ref/fate/sub-mcc-remux-eia608-recode
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
 
 UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
 Creation Program=FFmpeg
-Creation Date=Thursday, January 1, 1970
+Creation Date=Friday, January 2, 1970
 Creation Time=00:00:00
 Time Code Rate=30DF
 

-----------------------------------------------------------------------

Summary of changes:
 tests/fate/subtitles.mak                   | 12 ++++++------
 tests/ref/fate/sub-mcc-remux               |  2 +-
 tests/ref/fate/sub-mcc-remux-eia608        |  2 +-
 tests/ref/fate/sub-mcc-remux-eia608-bsf    |  2 +-
 tests/ref/fate/sub-mcc-remux-eia608-recode |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to