From 194ceabcc3149e95be6d9e2572f069a3ffd50f27 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Thu, 9 Feb 2017 10:23:19 -0700 Subject: [PATCH] libhb: fix Bob + CFR Same As Source + 2 Pass encode The bob filter predicts the resulting output framerate as 2 * input framerate. So during 2 pass encoding, we must adjust the framerate with the knows 1st pass values *after* any predictions made by filters. Fixes https://github.com/HandBrake/HandBrake/issues/556 (cherry picked from commit 6674825664c4847c74ccc99ef35a0c85f2df9eb8) --- libhb/work.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libhb/work.c b/libhb/work.c index 8aa920860..9010f1d3a 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1363,10 +1363,6 @@ static void do_job(hb_job_t *job) memset(interjob, 0, sizeof(*interjob)); interjob->sequence_id = job->sequence_id; } - else if (job->pass_id == HB_PASS_ENCODE_2ND) - { - correct_framerate(interjob, job); - } job->list_work = hb_list_init(); w = hb_get_work(job->h, WORK_READER); @@ -1484,6 +1480,11 @@ static void do_job(hb_job_t *job) job->cfr = 0; } + if (job->pass_id == HB_PASS_ENCODE_2ND) + { + correct_framerate(interjob, job); + } + /* * The frame rate may affect the bitstream's time base, lose superfluous * factors for consistency (some encoders reduce fractions, some don't). -- 2.40.0