From 672b037f187d4ead23b5fe0a9d8ed60aeca85677 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 30 Nov 2019 21:38:21 +0000 Subject: [PATCH] More accurate video pts calculation; may help with #1663. --- src/lib/ffmpeg_file_encoder.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index abde0c153..294b03162 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -260,7 +260,8 @@ FFmpegFileEncoder::video (shared_ptr video, DCPTime time) frame->width = image->size().width; frame->height = image->size().height; frame->format = _pixel_format; - frame->pts = time.seconds() / av_q2d (_video_stream->time_base); + DCPOMATIC_ASSERT (_video_stream->time_base.num == 1); + frame->pts = time.get() * _video_stream->time_base.den / DCPTime::HZ; AVPacket packet; av_init_packet (&packet); -- 2.30.2