summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_examiner.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-10-19 21:29:29 +0200
committerCarl Hetherington <cth@carlh.net>2024-10-19 21:29:29 +0200
commit24cfca51dffed98f0b115ca36f9a8478753e2432 (patch)
tree78e488d50ff70f17935270de051c5b1c8771ddde /src/lib/ffmpeg_examiner.cc
parent027dc03440ff0714b541b810264efa8722c87f39 (diff)
Fix video length when we scan for it.
Length is 1 frame more than the start time of the last frame.
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
-rw-r--r--src/lib/ffmpeg_examiner.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index b61089269..31f1a3d64 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -245,10 +245,10 @@ FFmpegExaminer::video_packet (AVCodecContext* context, string& temporal_referenc
_first_video = frame_time (_video_frame, _format_context->streams[_video_stream.get()]);
}
if (_need_video_length) {
- _video_length = frame_time (
+ _video_length = frame_time(
_video_frame,
_format_context->streams[_video_stream.get()]
- ).get_value_or (ContentTime ()).frames_round (video_frame_rate().get ());
+ ).get_value_or({}).frames_round(video_frame_rate().get()) + 1;
}
if (temporal_reference.size() < (PULLDOWN_CHECK_FRAMES * 2)) {
temporal_reference += (_video_frame->top_field_first ? "T" : "B");