summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-12 01:02:51 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-12 01:24:06 +0100
commit4285ff59480d526161905ecdc5fc05b57be7ed58 (patch)
tree129a2d4bc940b7414220d1c8d2d3bb27d20676ca /src/lib
parentef526ea3d6d6196f0e38ac9770504877388fc47a (diff)
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.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_decoder.cc2
1 files changed, 1 insertions, 1 deletions
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<int>(_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) {