| 3717 | } |
| 3718 | |
| 3719 | static int CheckOptions( int argc, char ** argv ) |
| 3720 | { |
| 3721 | if (queue_import_name != NULL) |
| 3722 | { |
| 3723 | // Everything should be defined in the queue. |
| 3724 | return 0; |
| 3725 | } |
| 3726 | |
| 3727 | if (preset_export_name == NULL && (input == NULL || *input == '\0')) |
| 3728 | { |
| 3729 | fprintf( stderr, "Missing input device. Run %s --help for " |
| 3730 | "syntax.\n", argv[0] ); |
| 3731 | return 1; |
| 3732 | } |
| 3733 | |
| 3734 | /* Parse format */ |
| 3735 | if (titleindex > 0 && !titlescan) |
| 3736 | { |
| 3737 | if (preset_export_name == NULL && (output == NULL || *output == '\0')) |
| 3738 | { |
| 3739 | fprintf( stderr, "Missing output file name. Run %s --help " |
| 3740 | "for syntax.\n", argv[0] ); |
| 3741 | return 1; |
| 3742 | } |
| 3743 | |
| 3744 | if (format == NULL && output != NULL) |
| 3745 | { |
| 3746 | /* autodetect */ |
| 3747 | const char *extension = strrchr(output, '.'); |
| 3748 | if (extension != NULL) |
| 3749 | { |
| 3750 | // skip '.' |
| 3751 | mux = hb_container_get_from_extension(extension + 1); |
| 3752 | } |
| 3753 | hb_container_t * c = hb_container_get_from_format(mux); |
| 3754 | if (c != NULL) |
| 3755 | format = strdup(c->short_name); |
| 3756 | } |
| 3757 | } |
| 3758 | |
| 3759 | int subtitle_track_count = count_subtitles(subtracks); |
| 3760 | if (subtitle_track_count > 0 && subtitle_lang_list != NULL) |
| 3761 | { |
| 3762 | fprintf(stderr, |
| 3763 | "Incompatible options: --subtitle-lang-list and --subtitle\n"); |
| 3764 | return 1; |
| 3765 | } |
| 3766 | |
| 3767 | if (subtitle_track_count > 0 && subtitle_all != -1) |
| 3768 | { |
| 3769 | fprintf(stderr, |
| 3770 | "Incompatible options: --all-subtitles/--first-subtitle and --subtitle\n"); |
| 3771 | return 1; |
| 3772 | } |
| 3773 | |
| 3774 | if (atracks != NULL && audio_lang_list != NULL) |
| 3775 | { |
| 3776 | fprintf(stderr, |
no test coverage detected