summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-03-07 22:25:48 +0000
committerjstebbins <[email protected]>2015-03-07 22:25:48 +0000
commit7705413a03a90c16734b40fb7bc492be8b56ab6f (patch)
tree2b3c861e0a7b78e45869a191b20f7dc57c0fe48b /libhb/encavcodec.c
parenta4ad5062c3fa1787b208389123bb81ea57483142 (diff)
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
Diffstat (limited to 'libhb/encavcodec.c')
-rw-r--r--libhb/encavcodec.c12
1 files changed, 7 insertions, 5 deletions
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 );
}