/* 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