[Mplayer-cvslog] CVS: main/libmpdemux cache2.c,1.5,1.6

Arpi of Ize arpi at mplayer.dev.hu
Mon Oct 22 18:09:44 CEST 2001


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

Modified Files:
	cache2.c 
Log Message:
printf->mp_msg

Index: cache2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/cache2.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- cache2.c	21 Oct 2001 22:13:12 -0000	1.5
+++ cache2.c	22 Oct 2001 16:09:34 -0000	1.6
@@ -16,6 +16,8 @@
 
 #include "../linux/shmem.h"
 
+#include "mp_msg.h"
+
 #include "stream.h"
 
 int stream_fill_buffer(stream_t *s);
@@ -83,7 +85,7 @@
     if(newb>size) newb=size;
     
     // check:
-    if(s->read_filepos<s->min_filepos) printf("Ehh. s->read_filepos<s->min_filepos !!! Report bug...\n");
+    if(s->read_filepos<s->min_filepos) mp_msg(MSGT_CACHE,MSGL_ERR,"Ehh. s->read_filepos<s->min_filepos !!! Report bug...\n");
     
     // len=write(mem,newb)
     //printf("Buffer read: %d bytes\n",newb);
@@ -108,12 +110,12 @@
   
   if(read<s->min_filepos || read>s->max_filepos){
       // seek...
-      printf("Out of boundaries... seeking to 0x%X  \n",read);
+      mp_msg(MSGT_CACHE,MSGL_DBG2,"Out of boundaries... seeking to 0x%X  \n",read);
       s->offset= // FIXME!?
       s->min_filepos=s->max_filepos=read; // drop cache content :(
       if(s->stream->eof) stream_reset(s->stream);
       stream_seek(s->stream,read);
-      printf("Seek done. new pos: 0x%X  \n",(int)stream_tell(s->stream));
+      mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%X  \n",(int)stream_tell(s->stream));
   }
   
   // calc number of back-bytes:
@@ -213,7 +215,7 @@
 
 //  cache_stats(s->cache_data);
 
-  if(s->pos!=((cache_vars_t*)s->cache_data)->read_filepos) printf("!!! read_filepos differs!!! report this bug...\n");
+  if(s->pos!=((cache_vars_t*)s->cache_data)->read_filepos) mp_msg(MSGT_CACHE,MSGL_ERR,"!!! read_filepos differs!!! report this bug...\n");
 
   len=cache_read(s->cache_data,s->buffer, ((cache_vars_t*)s->cache_data)->sector_size);
   //printf("cache_stream_fill_buffer->read -> %d\n",len);
@@ -235,7 +237,7 @@
   s=stream->cache_data;
 //  s->seek_lock=1;
   
-  printf("CACHE2_SEEK: 0x%X <= 0x%X (0x%X) <= 0x%X  \n",s->min_filepos,(int)pos,s->read_filepos,s->max_filepos);
+  mp_msg(MSGT_CACHE,MSGL_DBG2,"CACHE2_SEEK: 0x%X <= 0x%X (0x%X) <= 0x%X  \n",s->min_filepos,(int)pos,s->read_filepos,s->max_filepos);
 
   newpos=pos/s->sector_size; newpos*=s->sector_size; // align
   stream->pos=s->read_filepos=newpos;
@@ -252,7 +254,11 @@
 //  stream->buf_pos=stream->buf_len=0;
 //  return 1;
 
-  printf("cache_stream_seek: WARNING! Can't seek to 0x%X !\n",(int)(pos+newpos));
+#ifdef _LARGEFILE_SOURCE
+  mp_msg(MSGT_CACHE,MSGL_V,"cache_stream_seek: WARNING! Can't seek to 0x%llX !\n",(long long)(pos+newpos));
+#else
+  mp_msg(MSGT_CACHE,MSGL_V,"cache_stream_seek: WARNING! Can't seek to 0x%X !\n",(pos+newpos));
+#endif
   return 0;
 }
 




More information about the MPlayer-cvslog mailing list