- /* We assume that dcp_length() is valid */
- SourceFrame const left = _film->dcp_trim_start() + _film->dcp_length().get() - _encoder->video_frame();
+ if (!_film->length()) {
+ return 0;
+ }
+
+ /* Compute approximate proposed length here, as it's only here that we need it */
+ int length = _film->length().get();
+ FrameRateConversion const frc (_film->source_frame_rate(), _film->dcp_frame_rate());
+ if (frc.skip) {
+ length /= 2;
+ }
+ /* If we are repeating it shouldn't affect transcode time, so don't take it into account */
+
+ /* We assume that dcp_length() is valid, if it is set */
+ int const left = length - _encoder->video_frames_out();