mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-24 20:20:18 +08:00
lavf: if seeking in the desired direction failed, also try in the opposite one,
otherwise we might end up at some random position (where lavf last ended up while trying to build the index). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29741 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
@@ -617,7 +617,10 @@ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, float audio
|
||||
} else {
|
||||
priv->last_pts += rel_seek_secs * AV_TIME_BASE;
|
||||
}
|
||||
av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
|
||||
if (av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags) < 0) {
|
||||
avsflags ^= AVSEEK_FLAG_BACKWARD;
|
||||
av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
|
||||
}
|
||||
}
|
||||
|
||||
static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
|
||||
|
||||
Reference in New Issue
Block a user