From 463819ab7ee6bf65fe440b537118bc9ed718ac84 Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Fri, 10 Jan 2014 16:58:00 +0100 Subject: demux_qt: handle less audio than video. Dont hang when user seeks behind the end of audio while there is still some video left. --- src/demuxers/demux_qt.c | 7 +++++-- 1 file 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; } -- cgit v1.2.3