This commit is contained in:
theluyuan 2024-03-28 20:53:25 +08:00
parent a5a7545d6e
commit 59e8212941

View File

@ -327,7 +327,7 @@ void get_dir_path(char *filename, char *dir_path)
/* Get absolute path of output XML file */
if (_fullpath(abs_path, filename, MAX_PATH) == NULL)
{
printf( "Cannot determine absolute path for: %s\n", filename);
printf( "Cannot determine absolute path for: %s\r\n", filename);
exit(1);
}
@ -338,7 +338,7 @@ void get_dir_path(char *filename, char *dir_path)
if (strlen(dir_path) > MAX_PATH - 16)
{
printf( "Path for PNG files too long.\n");
printf( "Path for PNG files too long.\r\n");
exit(1);
}
}
@ -372,7 +372,7 @@ void write_png(char *dir, int file_id, uint8_t *image, int w, int h, int graphic
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL)
{
printf( "Cannot create png_ptr.\n");
printf( "Cannot create png_ptr.\r\n");
exit(1);
}
@ -381,7 +381,7 @@ void write_png(char *dir, int file_id, uint8_t *image, int w, int h, int graphic
if (info_ptr == NULL)
{
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
printf( "Cannot create info_ptr.\n");
printf( "Cannot create info_ptr.\r\n");
exit(1);
}
@ -390,7 +390,7 @@ void write_png(char *dir, int file_id, uint8_t *image, int w, int h, int graphic
{
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fh);
printf( "Error while writing PNG file: %s\n", filename);
printf( "Error while writing PNG file: %s\r\n", filename);
exit(1);
}
@ -536,9 +536,9 @@ int detect_sse2 ()
detection = (edx & 0x04000000) ? 1 : 0;
if (detection)
printf( "CPU: Using SSE2 optimized functions.\n");
printf( "CPU: Using SSE2 optimized functions.\r\n");
else
printf( "CPU: Using pure C functions.\n");
printf( "CPU: Using pure C functions.\r\n");
return detection;
}
@ -592,13 +592,13 @@ void mk_timecode (int frame, int fps, char *buf) /* buf must have length 12 (inc
if (h > 99)
{
printf( "Timecodes above 99:59:59:99 not supported: %u:%02u:%02u:%02u\n", h, m, s, frames);
printf( "Timecodes above 99:59:59:99 not supported: %u:%02u:%02u:%02u\r\n", h, m, s, frames);
exit(1);
}
if (snprintf(buf, 12, "%02d:%02d:%02d:%02d", h, m, s, frames) != 11)
{
printf( "Timecode lead to invalid format: %s\n", buf);
printf( "Timecode lead to invalid format: %s\r\n", buf);
exit(1);
}
}
@ -674,7 +674,7 @@ int parse_int(char *in, char *name, int *error)
*error = 1;
if (name != NULL)
{
printf( "Error: Failed to parse integer (%s): %s\n", name, in);
printf( "Error: Failed to parse integer (%s): %s\r\n", name, in);
exit(1);
}
}
@ -694,7 +694,7 @@ int parse_tc(char *in, int fps)
if (strlen(in) != 2 * 4 + 3 || in[2] != ':' || in[5] != ':' || in[8] != ':')
{
printf( "Error: Invalid timecode offset. Expected FRAMENUMBER or HH:MM:SS:FF, but got: %s\n", in);
printf( "Error: Invalid timecode offset. Expected FRAMENUMBER or HH:MM:SS:FF, but got: %s\r\n", in);
exit(1);
}
in[2] = 0;
@ -912,7 +912,7 @@ int main (int argc, char *argv[])
out_filename[out_filename_idx++] = optarg;
else
{
printf( "No more than two output filenames allowed.\nIf more than one is used, the other must have a\ndifferent output format.\n");
printf( "No more than two output filenames allowed.\nIf more than one is used, the other must have a\ndifferent output format.\r\n");
exit(0);
}
break;
@ -983,7 +983,7 @@ int main (int argc, char *argv[])
avs_filename = argv[optind];
else
{
printf( "Only a single input file allowed.\n");
printf( "Only a single input file allowed.\r\n");
return 1;
}
@ -1016,13 +1016,13 @@ int main (int argc, char *argv[])
}
else
{
printf( "Output file extension must be \".xml\", \".sup\" or \".pgs\".\n");
printf( "Output file extension must be \".xml\", \".sup\" or \".pgs\".\r\n");
return 1;
}
}
if (sup_output > 1 || xml_output > 1)
{
printf( "If more than one output filename is used, they must have\ndifferent output formats.\n");
printf( "If more than one output filename is used, they must have\ndifferent output formats.\r\n");
exit(0);
}
@ -1062,7 +1062,7 @@ int main (int argc, char *argv[])
}
if (!have_fps)
{
printf( "Error: Invalid framerate (%s).\n", frame_rate);
printf( "Error: Invalid framerate (%s).\r\n", frame_rate);
return 1;
}
@ -1085,7 +1085,7 @@ int main (int argc, char *argv[])
/* Check minimum size */
if (s_info->i_width < 8 || s_info->i_height < 8)
{
printf( "Error: Video dimensions below 8x8 (%dx%d).\n", s_info->i_width, s_info->i_height);
printf( "Error: Video dimensions below 8x8 (%dx%d).\r\n", s_info->i_width, s_info->i_height);
return 1;
}
@ -1117,7 +1117,7 @@ int main (int argc, char *argv[])
/* No frames mean nothing to do */
if (count_frames < 1)
{
printf( "No frames found.\n");
printf( "No frames found.\r\n");
return 0;
}
@ -1141,7 +1141,7 @@ int main (int argc, char *argv[])
{
if (read_frame_avis(in_img, avis_hnd, i))
{
printf( "Error reading frame.\n");
printf( "Error reading frame.\r\n");
return 1;
}
checked_empty = 0;
@ -1230,7 +1230,7 @@ int main (int argc, char *argv[])
old_img = tmp;
}
printf( "\rProgress: %d/%d - Lines: %d - Done\n", i - init_frame, count_frames, num_of_events);
printf( "Progress: %d/%d - Lines: %d - Done\r\n", i - init_frame, count_frames, num_of_events);
/* Add last event, if available */
if (have_line)
@ -1265,7 +1265,7 @@ int main (int argc, char *argv[])
{
if (!allow_empty)
{
printf( "No events detected. Cowardly refusing to write XML file.\n");
printf( "No events detected. Cowardly refusing to write XML file.\r\n");
return 0;
}
else
@ -1341,7 +1341,7 @@ int main (int argc, char *argv[])
/* Give runtime */
if (0)
printf( "Time elapsed: %lu\n", time(NULL) - bench_start);
printf( "Time elapsed: %lu\r\n", time(NULL) - bench_start);
return 0;
}