From 872aee88cd477d082a36124e83205689999d2527 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Tue, 28 Feb 2017 14:59:06 -0700 Subject: work: set orig_vrate correctly It was getting set to the title's rate instead of the rate that the filter chain sets. An incorrect vrate causes x265 rate control breakage. Fixes https://github.com/HandBrake/HandBrake/issues/600 --- libhb/work.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libhb/work.c b/libhb/work.c index ad11ee005..831f83a8b 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1355,7 +1355,6 @@ static void do_job(hb_job_t *job) title = job->title; interjob = hb_interjob_get(job->h); - job->orig_vrate = job->vrate; if (job->sequence_id != interjob->sequence_id) { // New job sequence, clear interjob @@ -1480,6 +1479,7 @@ static void do_job(hb_job_t *job) job->cfr = 0; } + job->orig_vrate = job->vrate; if (job->pass_id == HB_PASS_ENCODE_2ND) { correct_framerate(interjob, job); @@ -1489,6 +1489,8 @@ static void do_job(hb_job_t *job) * The frame rate may affect the bitstream's time base, lose superfluous * factors for consistency (some encoders reduce fractions, some don't). */ + hb_reduce(&job->orig_vrate.num, &job->orig_vrate.den, + job->orig_vrate.num, job->orig_vrate.den); hb_reduce(&job->vrate.num, &job->vrate.den, job->vrate.num, job->vrate.den); -- cgit v1.2.3