diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-03-12 01:02:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-03-12 01:24:06 +0100 |
| commit | 4285ff59480d526161905ecdc5fc05b57be7ed58 (patch) | |
| tree | 129a2d4bc940b7414220d1c8d2d3bb27d20676ca | |
| parent | ef526ea3d6d6196f0e38ac9770504877388fc47a (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.
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 2 |
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) { |
