MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / CheckOptions

Function CheckOptions

test/test.c:3719–3810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3717}
3718
3719static 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,

Callers 1

mainFunction · 0.85

Calls 3

count_subtitlesFunction · 0.85

Tested by

no test coverage detected