summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.c
diff options
context:
space:
mode:
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 );
}