summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorvan <[email protected]>2008-01-22 17:05:12 +0000
committervan <[email protected]>2008-01-22 17:05:12 +0000
commit65e4912bbe27922103a915e61f15baff17f8f55e (patch)
tree98625e90d0dddb707e9a8ac6f183664c8da8de64 /libhb
parent268d3b2e758ff1cf65cd03f354c5c32c8014b71f (diff)
account for quantization bias when computing durations for vfr.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1224 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/muxmp4.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c
index 989bb9607..0959c6e48 100644
--- a/libhb/muxmp4.c
+++ b/libhb/muxmp4.c
@@ -416,14 +416,8 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
/* Because we use the audio samplerate as the timescale,
we have to use potentially variable durations so the video
doesn't go out of sync */
- if ( job->vfr )
- {
- duration = ( ( buf->stop * job->arate / 90000 ) - ( buf->start * job->arate / 90000 ) );
- }
- else
- {
- duration = ( buf->stop * job->arate / 90000 ) - m->sum_dur;
- }
+ int64_t bias = ( buf->start * job->arate / 90000 ) - m->sum_dur;
+ duration = ( buf->stop - buf->start ) * job->arate / 90000 + bias;
m->sum_dur += duration;
}
else