From 848610a002d529a3131c270db5d47afaea088a47 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 3 Aug 2010 05:18:28 +0000 Subject: [PATCH] cache: Don't mess up current position if time-based seek fails Avoid STREAM_CTRL_SEEK_TO_TIME messing up the current position for stream types which do not support it. Fixes seeking in local flv files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31907 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/cache2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream/cache2.c b/stream/cache2.c index 6e77cbcc7e..914f20d601 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -599,7 +599,8 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) { case STREAM_CTRL_SEEK_TO_CHAPTER: case STREAM_CTRL_SEEK_TO_TIME: case STREAM_CTRL_SET_ANGLE: - stream->pos = s->read_filepos = s->control_new_pos; + if (s->control_res != STREAM_UNSUPPORTED) + stream->pos = s->read_filepos = s->control_new_pos; break; } return s->control_res;