summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-24 12:40:43 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-24 12:40:43 +0100
commitebd495da2fe5be8c07cf7fb52e8283bb7f4113c1 (patch)
tree93c0f449f19258d5f3c2d7b6b205b54966c4c7a7 /src/lib/ffmpeg_decoder.cc
parent64a2f1bb6a7b972607fa363631ef7a47444e8217 (diff)
Allow drag of content; fix up some problems with timings.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index b45ba8585..799e89a38 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -473,7 +473,6 @@ void
FFmpegDecoder::do_seek (Time t, bool backwards, bool accurate)
{
int64_t const vt = t / (av_q2d (_format_context->streams[_video_stream]->time_base) * TIME_HZ);
- cout << "seek-> " << t << "\n";
av_seek_frame (_format_context, _video_stream, vt, backwards ? AVSEEK_FLAG_BACKWARD : 0);
avcodec_flush_buffers (_video_codec_context);
@@ -617,5 +616,13 @@ FFmpegDecoder::decode_video_packet ()
Time
FFmpegDecoder::next () const
{
- return min (_next_video, _next_audio);
+ if (_decode_video && _decode_audio) {
+ return min (_next_video, _next_audio);
+ }
+
+ if (_decode_audio) {
+ return _next_audio;
+ }
+
+ return _next_video;
}