changeset 25842:f8fe66772c3a

Used wrong condition for using AVSEEK_FLAG_BACKWARD, it should depend on relative vs. absolute, not time- vs. percent-based seek.
author reimar
date Sat, 26 Jan 2008 22:06:36 +0000
parents 86aa99edff16
children 245e2ffbb2d5
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Jan 26 21:45:31 2008 +0000
+++ b/libmpdemux/demux_lavf.c	Sat Jan 26 22:06:36 2008 +0000
@@ -611,15 +611,16 @@
     int avsflags = 0;
     mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_seek_lavf(%p, %f, %f, %d)\n", demuxer, rel_seek_secs, audio_delay, flags);
 
-    if (flags & 1) // absolute seek
+    if (flags & 1) { // absolute seek
       priv->last_pts = priv->avfc->start_time;
+      if (rel_seek_secs < 0) avsflags = AVSEEK_FLAG_BACKWARD;
+    }
     if (flags & 2) { // percent seek
       if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE)
         return;
       priv->last_pts += rel_seek_secs * priv->avfc->duration;
     } else {
       priv->last_pts += rel_seek_secs * AV_TIME_BASE;
-      if (rel_seek_secs < 0) avsflags = AVSEEK_FLAG_BACKWARD;
     }
     av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
 }