summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2014-01-10 16:58:00 +0100
committerTorsten Jager <t.jager@gmx.de>2014-01-10 16:58:00 +0100
commit463819ab7ee6bf65fe440b537118bc9ed718ac84 (patch)
tree0819e181f1393601f06ed84fcb1b27701625ec2b
parent552bc88536783305bc78664f1226d4e028935634 (diff)
downloadxine-lib-463819ab7ee6bf65fe440b537118bc9ed718ac84.tar.gz
xine-lib-463819ab7ee6bf65fe440b537118bc9ed718ac84.tar.bz2
demux_qt: handle less audio than video.
Dont hang when user seeks behind the end of audio while there is still some video left.
-rw-r--r--src/demuxers/demux_qt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index de00dd8ab..f9aace0da 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001-2013 the xine project
+ * Copyright (C) 2001-2014 the xine project
*
* This file is part of xine, a free video player.
*
@@ -3137,7 +3137,10 @@ static int demux_qt_seek (demux_plugin_t *this_gen,
* no video trak */
if (keyframe_pts >= 0) for (i = 0; i < this->qt->audio_trak_count; i++) {
audio_trak = &this->qt->traks[this->qt->audio_traks[i]];
- while (audio_trak->current_frame) {
+ if (keyframe_pts > audio_trak->frames[audio_trak->frame_count - 1].pts) {
+ /* whoops, this trak is too short, mark it finished */
+ audio_trak->current_frame = audio_trak->frame_count;
+ } else while (audio_trak->current_frame) {
if (audio_trak->frames[audio_trak->current_frame].pts <= keyframe_pts) {
break;
}