1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00

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
This commit is contained in:
reimar 2011-07-03 09:45:29 +00:00 committed by Uoti Urpala
parent 06d830687d
commit 61fe3dcd6c

View File

@ -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;