# HG changeset patch # User reimar # Date 1355859209 0 # Node ID ff4d8445f93e75200afe20ea4135adc557bcb669 # Parent 80521cdbc2725311cdeb9303d25b60a02db57ccb 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). diff -r 80521cdbc272 -r ff4d8445f93e libmpdemux/demux_lavf.c --- 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;