From 38b7516b5028a7c25c08da931e482ad62dc0daef Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 8 Mar 2016 23:11:56 -0600 Subject: [PATCH] When a seek fails, disable seeking with FFmpegReader. This fixes lots of issues with image sequences, but needs more testing to see if it causes issues with normal video files. --- src/FFmpegReader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 7afd9ff4..7bc06ac5 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1304,6 +1304,14 @@ void FFmpegReader::Seek(long int requested_frame) throw(TooManySeeks) is_seeking = false; seeking_pts = 0; seeking_frame = 0; + + // dislable seeking for this reader (since it failed) + // TODO: Find a safer way to do this... not sure how common it is for a seek to fail. + enable_seek = false; + + // Close and re-open file (basically seeking to frame 1) + Close(); + Open(); } } }