changeset 35603:ff4d8445f93e

Set AVSEEK_FLAG_BACKWARD also when seeking to the start of a file. Fixes -loop 0 with some files where libavformat seems to set a slightly off broken start_time value (probably, I have not yet analyzed in detail).
author reimar
date Tue, 18 Dec 2012 19:33:29 +0000
parents 80521cdbc272
children 5be881b963ec
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Tue Dec 18 10:51:55 2012 +0000
+++ b/libmpdemux/demux_lavf.c	Tue Dec 18 19:33:29 2012 +0000
@@ -684,9 +684,8 @@
     if (flags & SEEK_ABSOLUTE) {
       priv->last_pts = priv->avfc->start_time != AV_NOPTS_VALUE ?
                        priv->avfc->start_time : 0;
-    } else {
-      if (rel_seek_secs < 0) avsflags = AVSEEK_FLAG_BACKWARD;
     }
+    if (rel_seek_secs <= 0) avsflags = AVSEEK_FLAG_BACKWARD;
     if (flags & SEEK_FACTOR) {
       if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE)
         return;