summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-01-12 17:15:19 +0000
committerjstebbins <[email protected]>2015-01-12 17:15:19 +0000
commit84d152fecb516134d1d89d4689761430d6aa0a0d (patch)
tree325ba895366390a0ce2b2ca4ae5079e7a2fb9b50 /test/test.c
parent2d6aa981b2da6536051b4d350d3b491bd970a957 (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 'test/test.c')
-rw-r--r--test/test.c69
1 files changed, 3 insertions, 66 deletions
diff --git a/test/test.c b/test/test.c
index 4277f8172..59640d3f6 100644
--- a/test/test.c
+++ b/test/test.c
@@ -2810,74 +2810,11 @@ static int HandleEvents( hb_handle_t * h )
/* OpenCL */
job->use_opencl = use_opencl;
- if( subtitle_scan )
- {
- /*
- * When subtitle scan is enabled do a fast pre-scan job
- * which will determine which subtitles to enable, if any.
- */
- job->pass = -1;
-
- hb_job_set_encoder_options(job, NULL);
-
- job->indepth_scan = subtitle_scan;
- fprintf( stderr, "Subtitle Scan Enabled - enabling "
- "subtitles if found for foreign language segments\n");
-
- /*
- * Add the pre-scan job
- */
- hb_add( h, job );
- }
-
+ job->indepth_scan = subtitle_scan;
+ job->twopass = twoPass;
hb_job_set_encoder_options(job, advanced_opts);
- if( twoPass )
- {
- /*
- * If subtitle_scan is enabled then only turn it on
- * for the first pass and then off again for the
- * second.
- */
- job->pass = 1;
-
- job->indepth_scan = 0;
-
- /* Turbo first pass */
- if( turbo_opts_enabled )
- {
- job->fastfirstpass = 1;
- }
- else
- {
- job->fastfirstpass = 0;
- }
-
- 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;
-
- hb_add( h, job );
- }
- else
- {
- /*
- * Turn on subtitle scan if requested, note that this option
- * precludes encoding of any actual subtitles.
- */
-
- job->indepth_scan = 0;
- job->pass = 0;
-
- hb_add( h, job );
- }
+ hb_add( h, job );
hb_job_close( &job );
hb_start( h );
break;