summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2011-07-04 19:11:21 +0000
committerUoti Urpala <uau@mplayer2.org>2011-07-06 13:01:08 +0300
commit93e206e0626c1c5827ec738e7a0dbe0538b64545 (patch)
tree5bccc9e6742dfa4a7166a0485beb7f004243f9d9 /stream
parentc89f72b561a83c11d1abb171b1a9d17bc51c3b42 (diff)
downloadmpv-93e206e0626c1c5827ec738e7a0dbe0538b64545.tar.bz2
mpv-93e206e0626c1c5827ec738e7a0dbe0538b64545.tar.xz
stream/network: don't clobber buffer byte counts on error
Ensure we do not add strange values to amount of buffered bytes read on error. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33807 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/network.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/stream/network.c b/stream/network.c
index f6956e46da..ce04444144 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -467,6 +467,7 @@ nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctr
ret = recv( fd, buffer+len, size-len, 0 );
if( ret<0 ) {
mp_msg(MSGT_NETWORK,MSGL_ERR,"nop_streaming_read error : %s\n",strerror(errno));
+ ret = 0;
} else if (ret == 0)
stream_ctrl->status = streaming_stopped_e;
len += ret;