diff options
author | jstebbins <[email protected]> | 2015-01-12 17:15:19 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-01-12 17:15:19 +0000 |
commit | 84d152fecb516134d1d89d4689761430d6aa0a0d (patch) | |
tree | 325ba895366390a0ce2b2ca4ae5079e7a2fb9b50 /gtk/src | |
parent | 2d6aa981b2da6536051b4d350d3b491bd970a957 (diff) |
Simplify frontend useage of hb_add()
Modify hb_add() to automatically add all necessary passes, so hb_add()
only needs to be called once per job. It now automatically adds subtitle
scan and 2-pass encoding passes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6738 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/hb-backend.c | 72 |
1 files changed, 5 insertions, 67 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index da7252f78..509c9acc8 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -4178,7 +4178,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, int titleindex) hb_list_t * list; const hb_title_t * title; hb_job_t * job; - gint sub_id = 0; hb_filter_object_t * filter; gchar *filter_str; gchar *dest_str = NULL; @@ -4705,72 +4704,11 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, int titleindex) } free(meta); - if (job->indepth_scan == 1) - { - // Subtitle scan. Look for subtitle matching audio language - - /* - * When subtitle scan is enabled do a fast pre-scan job - * which will determine which subtitles to enable, if any. - */ - job->pass = -1; - job->indepth_scan = 1; - hb_job_set_encoder_options(job, NULL); - - /* - * Add the pre-scan job - */ - job->sequence_id = (unique_id & 0xFFFFFF) | (sub_id++ << 24); - hb_add( h, job ); - } - - if( ghb_settings_get_boolean(js, "VideoTwoPass") && - !ghb_settings_get_boolean(js, "vquality_type_constant")) - { - /* - * If subtitle_scan is enabled then only turn it on - * for the second pass and then off again for the - * second. - */ - job->pass = 1; - job->indepth_scan = 0; - ghb_set_video_encoder_opts(job, js); - - /* - * If turbo options have been selected then set job->fastfirstpass - */ - if(ghb_settings_get_boolean(js, "VideoTurboTwoPass") && - (job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_X265)) - { - job->fastfirstpass = 1; - } - else - { - job->fastfirstpass = 0; - } - - job->sequence_id = (unique_id & 0xFFFFFF) | (sub_id++ << 24); - hb_add( h, job ); - - job->pass = 2; - /* - * On the second pass we turn off subtitle scan so that we - * can actually encode using any subtitles that were auto - * selected in the first pass (using the whacky select-subtitle - * attribute of the job). - */ - job->indepth_scan = 0; - job->sequence_id = (unique_id & 0xFFFFFF) | (sub_id++ << 24); - hb_add( h, job ); - } - else - { - ghb_set_video_encoder_opts(job, js); - job->indepth_scan = 0; - job->pass = 0; - job->sequence_id = (unique_id & 0xFFFFFF) | (sub_id++ << 24); - hb_add( h, job ); - } + job->twopass = ghb_settings_get_boolean(js, "VideoTwoPass"); + job->fastfirstpass = ghb_settings_get_boolean(js, "VideoTurboTwoPass"); + job->sequence_id = unique_id; + ghb_set_video_encoder_opts(job, js); + hb_add(h, job); hb_job_close(&job); } |