summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-05 14:00:14 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-05 14:00:14 +0100
commitd755a06a076f10d1f44bd66fd7b0ea0e0b02a1c0 (patch)
tree3a6cd6ca80de5abe9e8bc10e653e43264c67f3ad
parent70bc37e2e8958c5f8959be0ac76536e8697d6d63 (diff)
Fix erroneous video position after seek.
-rw-r--r--src/lib/ffmpeg_decoder.cc5
-rw-r--r--test/play_test.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 5fe34ce14..04dd7fd2d 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -386,6 +386,11 @@ FFmpegDecoder::seek (VideoContent::Frame frame, bool accurate)
av_free_packet (&_packet);
}
+
+ /* _video_position should be the next thing to be emitted, which will the one after the thing
+ we just saw.
+ */
+ _video_position++;
}
void
diff --git a/test/play_test.cc b/test/play_test.cc
index 1ba2e7d88..92d1a8dce 100644
--- a/test/play_test.cc
+++ b/test/play_test.cc
@@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE (play_test)
}
}
- player->seek (10 * TIME_HZ / 25, true);
+ wrap.seek (10 * TIME_HZ / 25, true);
optional<Video> v = wrap.get_video ();
BOOST_CHECK (v);
BOOST_CHECK_EQUAL (v.get().time, 10 * TIME_HZ / 25);