More accurate video pts calculation; may help with #1663.
authorCarl Hetherington <cth@carlh.net>
Sat, 30 Nov 2019 21:38:21 +0000 (21:38 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 30 Nov 2019 21:38:21 +0000 (21:38 +0000)
src/lib/ffmpeg_file_encoder.cc

index abde0c1..294b031 100644 (file)
@@ -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);