[Mplayer-cvslog] CVS: main/libmpdemux stream.h,1.10,1.11

Arpi of Ize arpi at mplayer.dev.hu
Sun Oct 21 20:14:09 CEST 2001


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv23874

Modified Files:
	stream.h 
Log Message:
stream_read() now returns no. of bytes readed

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- stream.h	20 Oct 2001 23:51:02 -0000	1.10
+++ stream.h	21 Oct 2001 18:13:48 -0000	1.11
@@ -86,12 +86,13 @@
   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 @@
     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){




More information about the MPlayer-cvslog mailing list