summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-10 11:49:07 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-10 11:49:07 +0100
commit2f6167a81ab09b327eab9026d1dd40052fd7bdd0 (patch)
tree44da8f075b412ba86b9b664a6f6abc94b4b2bcf5 /src/lib/ffmpeg_decoder.cc
parent9e7697cd54968bcdec0d48781b3fb075629eecee (diff)
Fix initial display to be frame 1, not 2.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index bcd1e738a..785a805f4 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -294,6 +294,11 @@ FFmpegDecoder::seek (VideoContent::Frame frame, bool accurate)
_just_sought = true;
+ if (frame == 0) {
+ /* We're already there; from here on we can only seek non-zero amounts */
+ return;
+ }
+
if (accurate) {
while (1) {
int r = av_read_frame (_format_context, &_packet);
@@ -372,7 +377,7 @@ FFmpegDecoder::decode_video_packet ()
if (avcodec_decode_video2 (video_codec_context(), _frame, &frame_finished, &_packet) < 0 || !frame_finished) {
return false;
}
-
+
boost::mutex::scoped_lock lm (_filter_graphs_mutex);
shared_ptr<FilterGraph> graph;