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

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
This commit is contained in:
reimar 2011-07-04 19:11:21 +00:00 committed by Uoti Urpala
parent c89f72b561
commit 93e206e062

View File

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