Merge master.
[dcpomatic.git] / src / lib / ffmpeg_examiner.cc
index df12830f819eb182c2c04db9838e71f550e236ff..d9bcedfc528f196ba9a85b064d1f3900f32fdbbc 100644 (file)
@@ -176,7 +176,7 @@ FFmpegExaminer::video_size () const
 ContentTime
 FFmpegExaminer::video_length () const
 {
-       ContentTime const length = ContentTime::from_seconds (double (_format_context->duration) / AV_TIME_BASE);
+       ContentTime const length = ContentTime::from_seconds (double (_format_context->duration - _format_context->start_time) / AV_TIME_BASE);
        return ContentTime (max (int64_t (1), length.get ()));
 }