]> granicus.if.org Git - libx264/commitdiff
Fix --tcfile-in support
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 19 May 2021 16:40:22 +0000 (19:40 +0300)
committerAnton Mitrofanov <bugmaster@narod.ru>
Sun, 13 Jun 2021 20:25:24 +0000 (20:25 +0000)
Accept files created by MKVToolNix version 17.0.0 or newer.

input/timecode.c

index 007bce38b5e6095ab9b8786924ff38fd5afdc0c4..81f128409ea52371cc56aba2eb186da1a4fd506b 100644 (file)
@@ -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 )
     {