From 7705413a03a90c16734b40fb7bc492be8b56ab6f Mon Sep 17 00:00:00 2001 From: jstebbins Date: Sat, 7 Mar 2015 22:25:48 +0000 Subject: json: automatically scan title when processing json jobs Simplifies the WinGui. This also changes how jobs are processed. Creating the sub-jobs for multiple passes is delayed until after scanning and immediately before running the job. Working status has also changed. Sub-job passes are identified in status with an ID that allows the frontend to definitively identify what pass is in progress. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6976 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/encavcodec.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libhb/encavcodec.c') diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index b396f9c70..fe479a393 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -99,7 +99,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job ) // Set things in context that we will allow the user to // override with advanced settings. - if( job->pass == 2 ) + if( job->pass_id == HB_PASS_ENCODE_2ND ) { hb_interjob_t * interjob = hb_interjob_get( job->h ); fps.den = interjob->vrate.den; @@ -237,12 +237,13 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job ) context->flags |= CODEC_FLAG_GRAY; } - if( job->pass != 0 && job->pass != -1 ) + if( job->pass_id == HB_PASS_ENCODE_1ST || + job->pass_id == HB_PASS_ENCODE_2ND ) { char filename[1024]; memset( filename, 0, 1024 ); hb_get_tempory_filename( job->h, filename, "ffmpeg.log" ); - if( job->pass == 1 ) + if( job->pass_id == HB_PASS_ENCODE_1ST ) { pv->file = hb_fopen(filename, "wb"); context->flags |= CODEC_FLAG_PASS1; @@ -287,7 +288,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job ) { job->areBframes = 1; } - if( ( job->mux & HB_MUX_MASK_MP4 ) && job->pass != 1 ) + if( ( job->mux & HB_MUX_MASK_MP4 ) && job->pass_id != HB_PASS_ENCODE_1ST ) { w->config->mpeg4.length = context->extradata_size; memcpy( w->config->mpeg4.bytes, context->extradata, @@ -589,7 +590,8 @@ int encavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in, buf_last = buf; } /* Write stats */ - if (job->pass == 1 && pv->context->stats_out != NULL) + if (job->pass_id == HB_PASS_ENCODE_1ST && + pv->context->stats_out != NULL) { fprintf( pv->file, "%s", pv->context->stats_out ); } -- cgit v1.2.3