- fgets( buff, sizeof(buff), tcfile_in );
- if( buff[0] == '#' || buff[0] == '\n' || buff[0] == '\r' )
- continue;
- ret = sscanf( buff, "%lf", &timecodes[num] );
- timecodes[num] *= 1e-3; /* Timecode format v2 is expressed in milliseconds. */
- FAIL_IF_ERROR( ret != 1 || timecodes[num] <= timecodes[num - 1],
- "invalid input tcfile for frame %d\n", num )
- ++num;
+ ret = sscanf( buff, "%lf", &timecodes[0] );
+ timecodes[0] *= 1e-3; /* Timecode format v2 is expressed in milliseconds. */
+ FAIL_IF_ERROR( ret != 1, "invalid input tcfile for frame 0\n" )
+ for( num = 1; num < timecodes_num && fgets( buff, sizeof(buff), tcfile_in ) != NULL; )
+ {
+ if( NO_TIMECODE_LINE )
+ continue;
+ ret = sscanf( buff, "%lf", &timecodes[num] );
+ timecodes[num] *= 1e-3; /* Timecode format v2 is expressed in milliseconds. */
+ FAIL_IF_ERROR( ret != 1 || timecodes[num] <= timecodes[num - 1],
+ "invalid input tcfile for frame %d\n", num )
+ ++num;
+ }