[x264-devel] [Git][videolan/x264][master] Fix --tcfile-in support

Anton Mitrofanov gitlab at videolan.org
Sun Jun 13 20:28:27 UTC 2021



Anton Mitrofanov pushed to branch master at VideoLAN / x264


Commits:
88fab191 by Anton Mitrofanov at 2021-06-13T20:25:24+00:00
Fix --tcfile-in support

Accept files created by MKVToolNix version 17.0.0 or newer.

- - - - -


1 changed file:

- input/timecode.c


Changes:

=====================================
input/timecode.c
=====================================
@@ -100,8 +100,9 @@ static int parse_tcfile( FILE *tcfile_in, timecode_hnd_t *h, video_info_t *info
     double *timecodes = NULL;
     double *fpss = NULL;
 
-    ret = fscanf( tcfile_in, "# timecode format v%d", &tcfv );
-    FAIL_IF_ERROR( ret != 1 || (tcfv != 1 && tcfv != 2), "unsupported timecode format\n" );
+    ret = fgets( buff, sizeof(buff), tcfile_in ) != NULL && 
+          (sscanf( buff, "# timecode format v%d", &tcfv ) == 1 || sscanf( buff, "# timestamp format v%d", &tcfv ) == 1);
+    FAIL_IF_ERROR( !ret || (tcfv != 1 && tcfv != 2), "unsupported timecode format\n" );
 #define NO_TIMECODE_LINE (buff[0] == '#' || buff[0] == '\n' || buff[0] == '\r')
     if( tcfv == 1 )
     {



View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/88fab191002fa4af4a574395d7dbc4eaa82b657c

-- 
View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/88fab191002fa4af4a574395d7dbc4eaa82b657c
You're receiving this email because of your account on code.videolan.org.




More information about the x264-devel mailing list