summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-11-30 21:38:21 +0000
committerCarl Hetherington <cth@carlh.net>2019-11-30 21:38:21 +0000
commit672b037f187d4ead23b5fe0a9d8ed60aeca85677 (patch)
treeb4fd6313a4c3fefc8171c618f0317a6553dea35b /src/lib
parent8e2c92bcbfe67a47e790ca842d6c99376789f2b7 (diff)
More accurate video pts calculation; may help with #1663.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_file_encoder.cc3
1 files changed, 2 insertions, 1 deletions
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<PlayerVideo> 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);