# HG changeset patch # User reimar # Date 1355860811 0 # Node ID 5be881b963ec1528edb3c73aec7837755deb7c24 # Parent ff4d8445f93e75200afe20ea4135adc557bcb669 Add comment why seeking backward flag is used when seeking to the start. diff -r ff4d8445f93e -r 5be881b963ec libmpdemux/demux_lavf.c --- a/libmpdemux/demux_lavf.c Tue Dec 18 19:33:29 2012 +0000 +++ b/libmpdemux/demux_lavf.c Tue Dec 18 20:00:11 2012 +0000 @@ -685,6 +685,9 @@ priv->last_pts = priv->avfc->start_time != AV_NOPTS_VALUE ? priv->avfc->start_time : 0; } + // This is important also for SEEK_ABSOLUTE because seeking + // is done by dts, while start_time is relative to pts and thus + // usually too large. if (rel_seek_secs <= 0) avsflags = AVSEEK_FLAG_BACKWARD; if (flags & SEEK_FACTOR) { if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE)