summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-07-28 09:21:48 +0100
committerCarl Hetherington <cth@carlh.net>2016-07-28 09:21:48 +0100
commit6ec390c3a6259848cb6a85ee5dfda79f76161942 (patch)
tree987960273cb4ee19620961504f8d9e5132c20498 /src/lib/ffmpeg_decoder.cc
parentaf122f0f10c23e81a5d1de2ea11112a0e998aa5a (diff)
Some more fixes missing from 2704fe5.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index f7c435a74..a47cd405d 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -348,12 +348,14 @@ FFmpegDecoder::seek (ContentTime time, bool accurate)
}
av_seek_frame (
_format_context,
- _video_stream.get(),
- u.seconds() / av_q2d (_format_context->streams[_video_stream.get()]->time_base),
+ stream.get(),
+ u.seconds() / av_q2d (_format_context->streams[stream.get()]->time_base),
AVSEEK_FLAG_BACKWARD
);
- avcodec_flush_buffers (video_codec_context());
+ if (video_codec_context ()) {
+ avcodec_flush_buffers (video_codec_context());
+ }
/* XXX: should be flushing audio buffers? */