diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2011-07-03 09:45:29 +0000 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-06 13:01:08 +0300 |
commit | 61fe3dcd6c87b96f02c5c0924b4124bc7a165d34 (patch) | |
tree | 3c7ef9df1149f7d5ba5c8ac47409dc9dce620a75 /stream | |
parent | 06d830687d5c57f7d5016ae4d0fccaa7b6780bad (diff) | |
download | mpv-61fe3dcd6c87b96f02c5c0924b4124bc7a165d34.tar.bz2 mpv-61fe3dcd6c87b96f02c5c0924b4124bc7a165d34.tar.xz |
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
Diffstat (limited to 'stream')
-rw-r--r-- | stream/cache2.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |