Fix audio pts accuracy from previous.
authorCarl Hetherington <cth@carlh.net>
Sun, 1 Dec 2019 13:48:59 +0000 (14:48 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 1 Dec 2019 13:48:59 +0000 (14:48 +0100)
src/lib/ffmpeg_file_encoder.cc

index 7bac7b1..e980900 100644 (file)
@@ -393,7 +393,8 @@ FFmpegFileEncoder::audio_frame (int size)
                DCPOMATIC_ASSERT (false);
        }
 
-       frame->pts = _audio_frames / (av_q2d (_audio_stream->time_base) * _audio_frame_rate);
+       DCPOMATIC_ASSERT (_audio_stream->time_base.num == 1);
+       frame->pts = _audio_frames * _audio_stream->time_base.den / _audio_frame_rate;
 
        AVPacket packet;
        av_init_packet (&packet);