OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 printf(" %s\n", filename); | 512 printf(" %s\n", filename); |
513 } | 513 } |
514 | 514 |
515 static FILE *open_outfile(const char *name) { | 515 static FILE *open_outfile(const char *name) { |
516 if (strcmp("-", name) == 0) { | 516 if (strcmp("-", name) == 0) { |
517 set_binary_mode(stdout); | 517 set_binary_mode(stdout); |
518 return stdout; | 518 return stdout; |
519 } else { | 519 } else { |
520 FILE *file = fopen(name, "wb"); | 520 FILE *file = fopen(name, "wb"); |
521 if (!file) | 521 if (!file) |
522 fatal("Failed to output file %s", name); | 522 fatal("Failed to open output file '%s'", name); |
523 return file; | 523 return file; |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 527 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
528 static int img_shifted_realloc_required(const vpx_image_t *img, | 528 static int img_shifted_realloc_required(const vpx_image_t *img, |
529 const vpx_image_t *shifted, | 529 const vpx_image_t *shifted, |
530 vpx_img_fmt_t required_fmt) { | 530 vpx_img_fmt_t required_fmt) { |
531 return img->d_w != shifted->d_w || | 531 return img->d_w != shifted->d_w || |
532 img->d_h != shifted->d_h || | 532 img->d_h != shifted->d_h || |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 } | 711 } |
712 | 712 |
713 /* Check for unrecognized options */ | 713 /* Check for unrecognized options */ |
714 for (argi = argv; *argi; argi++) | 714 for (argi = argv; *argi; argi++) |
715 if (argi[0][0] == '-' && strlen(argi[0]) > 1) | 715 if (argi[0][0] == '-' && strlen(argi[0]) > 1) |
716 die("Error: Unrecognized option %s\n", *argi); | 716 die("Error: Unrecognized option %s\n", *argi); |
717 | 717 |
718 /* Handle non-option arguments */ | 718 /* Handle non-option arguments */ |
719 fn = argv[0]; | 719 fn = argv[0]; |
720 | 720 |
721 if (!fn) | 721 if (!fn) { |
| 722 free(argv); |
722 usage_exit(); | 723 usage_exit(); |
723 | 724 } |
724 /* Open file */ | 725 /* Open file */ |
725 infile = strcmp(fn, "-") ? fopen(fn, "rb") : set_binary_mode(stdin); | 726 infile = strcmp(fn, "-") ? fopen(fn, "rb") : set_binary_mode(stdin); |
726 | 727 |
727 if (!infile) { | 728 if (!infile) { |
728 fprintf(stderr, "Failed to open file '%s'", strcmp(fn, "-") ? fn : "stdin"); | 729 fatal("Failed to open input file '%s'", strcmp(fn, "-") ? fn : "stdin"); |
729 return EXIT_FAILURE; | |
730 } | 730 } |
731 #if CONFIG_OS_SUPPORT | 731 #if CONFIG_OS_SUPPORT |
732 /* Make sure we don't dump to the terminal, unless forced to with -o - */ | 732 /* Make sure we don't dump to the terminal, unless forced to with -o - */ |
733 if (!outfile_pattern && isatty(fileno(stdout)) && !do_md5 && !noblit) { | 733 if (!outfile_pattern && isatty(fileno(stdout)) && !do_md5 && !noblit) { |
734 fprintf(stderr, | 734 fprintf(stderr, |
735 "Not dumping raw video to your terminal. Use '-o -' to " | 735 "Not dumping raw video to your terminal. Use '-o -' to " |
736 "override.\n"); | 736 "override.\n"); |
737 return EXIT_FAILURE; | 737 return EXIT_FAILURE; |
738 } | 738 } |
739 #endif | 739 #endif |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 if (arg_match(&arg, &looparg, argi)) { | 1129 if (arg_match(&arg, &looparg, argi)) { |
1130 loops = arg_parse_uint(&arg); | 1130 loops = arg_parse_uint(&arg); |
1131 break; | 1131 break; |
1132 } | 1132 } |
1133 } | 1133 } |
1134 free(argv); | 1134 free(argv); |
1135 for (i = 0; !error && i < loops; i++) | 1135 for (i = 0; !error && i < loops; i++) |
1136 error = main_loop(argc, argv_); | 1136 error = main_loop(argc, argv_); |
1137 return error; | 1137 return error; |
1138 } | 1138 } |
OLD | NEW |