From 4285ff59480d526161905ecdc5fc05b57be7ed58 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 12 Mar 2026 01:02:51 +0100 Subject: Use dts rather than pts when noting the time of frames we are ignoring. The docs for av_read_frame() say "pkt->pts can be AV_NOPTS_VALUE if the video format has B-frames, so it is better to rely on pkt->dts if you do not decompress the payload." Before this there could be long hangs while we go through many packets without pts values. --- src/lib/ffmpeg_decoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg_decoder.cc') diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index d2540d17a..0f38b3247 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -246,7 +246,7 @@ FFmpegDecoder::pass () decode_and_process_audio_packet (packet); } else { DCPOMATIC_ASSERT(static_cast(_dropped_time.size()) > si); - _dropped_time[si] = dcpomatic::ContentTime::from_seconds(packet->pts * av_q2d(_format_context->streams[si]->time_base) + _pts_offset.seconds()); + _dropped_time[si] = dcpomatic::ContentTime::from_seconds(packet->dts * av_q2d(_format_context->streams[si]->time_base) + _pts_offset.seconds()); } if (_have_current_subtitle && _current_subtitle_to && position() > *_current_subtitle_to) { -- cgit v1.2.3