summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-21 18:13:48 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-21 18:13:48 +0000
commit52ad3e1c73ca63a9afc67ffd11e961c5d88724ce (patch)
treea72eb224f3610b34744ec1387848c6969ee8a530 /libmpdemux
parent69fee563a1e3c0845e9ea856f4ec9eb9d7ad7e64 (diff)
downloadmpv-52ad3e1c73ca63a9afc67ffd11e961c5d88724ce.tar.bz2
mpv-52ad3e1c73ca63a9afc67ffd11e961c5d88724ce.tar.xz
stream_read() now returns no. of bytes readed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2348 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/stream.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpdemux/stream.h b/libmpdemux/stream.h
index 72dd21ed4f..8a3c340989 100644
--- a/libmpdemux/stream.h
+++ b/libmpdemux/stream.h
@@ -86,12 +86,13 @@ inline static unsigned int stream_read_dword_le(stream_t *s){
return y;
}
-inline static void stream_read(stream_t *s,char* mem,int len){
+inline static int stream_read(stream_t *s,char* mem,int total){
+ int len=total;
while(len>0){
int x;
x=s->buf_len-s->buf_pos;
if(x==0){
- if(!cache_stream_fill_buffer(s)) return; // EOF
+ if(!cache_stream_fill_buffer(s)) return total-len; // EOF
x=s->buf_len-s->buf_pos;
}
if(s->buf_pos>s->buf_len) printf("stream_read: WARNING! s->buf_pos>s->buf_len\n");
@@ -99,6 +100,7 @@ inline static void stream_read(stream_t *s,char* mem,int len){
memcpy(mem,&s->buffer[s->buf_pos],x);
s->buf_pos+=x; mem+=x; len-=x;
}
+ return total;
}
inline static int stream_eof(stream_t *s){