Fix subtitle timing under trim.
[dcpomatic.git] / src / lib / ffmpeg.cc
index de08e9df9394a5c6bea3b34b2eca4eebc40b9dda..29dee2c86d1e7679c15d7b6442529c8298d9d7ae 100644 (file)
@@ -314,7 +314,8 @@ FFmpeg::pts_offset (vector<shared_ptr<FFmpegAudioStream> > audio_streams, option
 
        /* Now adjust so that the video pts starts on a frame */
        if (first_video) {
-               po += first_video.get().round_up (video_frame_rate) - first_video.get();
+               ContentTime const fvc = first_video.get() + po;
+               po += fvc.round_up (video_frame_rate) - fvc;
        }
 
        return po;