summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-26 00:18:07 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-26 00:18:07 +0100
commit1711d2804cb0a24b1883a991b46a8842bdd24415 (patch)
tree7804bf8f30bc594ea1bfb6f681df48db64f92453
parentc38648f30eb24c88e2af2927ba60acbf7e353fe8 (diff)
Account for FFmpeg content start_time being non-zero:
Reported-by: Sumit Guha
-rw-r--r--ChangeLog4
-rw-r--r--src/lib/ffmpeg_examiner.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f7cb5e5c..440de949c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-26 Carl Hetherington <cth@carlh.net>
+
+ * Fix problems with non-zero FFmpeg content start times.
+
2014-05-24 Carl Hetherington <cth@carlh.net>
* Version 1.69.13 released.
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index ec090ed61..d73063083 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -137,7 +137,7 @@ FFmpegExaminer::video_size () const
VideoContent::Frame
FFmpegExaminer::video_length () const
{
- VideoContent::Frame const length = (double (_format_context->duration) / AV_TIME_BASE) * video_frame_rate();
+ VideoContent::Frame const length = (double (_format_context->duration - _format_context->start_time) / AV_TIME_BASE) * video_frame_rate();
return max (1, length);
}