From 37c7902ff39754f5467b6dee5ed945afc9d4d652 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 2 Jul 2002 17:05:28 +0000 Subject: fix time seeking to keyframe (patch by Staszek Pasko ) CVS patchset: 2197 CVS date: 2002/07/02 17:05:28 --- src/demuxers/demux_avi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 9e718b8dd..2be4d44c4 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_avi.c,v 1.98 2002/06/25 03:37:53 tmmm Exp $ + * $Id: demux_avi.c,v 1.99 2002/07/02 17:05:28 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -1317,11 +1317,14 @@ static int demux_avi_start (demux_plugin_t *this_gen, * point. This could in theory be turned into a binary search, * but it's a linear search for now. */ while(1) { - if (get_video_pts (this, this->avi->video_posf) >= video_pts) { - break; - } - this->avi->video_posf += 1; + vie = video_cur_index_entry(this); + if ((get_video_pts (this, this->avi->video_posf) >= video_pts) + && (vie->flags & AVIIF_KEYFRAME)) { + break; + } + this->avi->video_posf += 1; } + video_pts = get_video_pts (this, this->avi->video_posf); } } -- cgit v1.2.3