From 61fe3dcd6c87b96f02c5c0924b4124bc7a165d34 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 3 Jul 2011 09:45:29 +0000 Subject: cache: don't modify argument when stream control fails When handling STREAM_CTRL calls for the cached stream, do not modify the return parameter if the underlying stream returns an error for the operation. Avoids issues with some places that don't check the return value of stream_control. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33802 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove condition that is now always true. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33803 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/cache2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'stream') diff --git a/stream/cache2.c b/stream/cache2.c index b643ed8897..6e8f398c37 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -615,6 +615,8 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) { return STREAM_UNSUPPORTED; } } + if (s->control_res != STREAM_OK) + return s->control_res; switch (cmd) { case STREAM_CTRL_GET_TIME_LENGTH: case STREAM_CTRL_GET_CURRENT_TIME: @@ -630,8 +632,7 @@ 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: - if (s->control_res != STREAM_UNSUPPORTED) - stream->pos = s->read_filepos = s->control_new_pos; + stream->pos = s->read_filepos = s->control_new_pos; break; } return s->control_res; -- cgit v1.2.3