comparison stream/cache2.c @ 32037:7459e0a25235

Remove unused cache_stats function.
author diego
date Thu, 09 Sep 2010 16:57:05 +0000
parents f1e3d7471ac8
children faefba58f413
comparison
equal deleted inserted replaced
32036:dbca781e632f 32037:7459e0a25235
103 // signal process to wake up immediately 103 // signal process to wake up immediately
104 kill(s->cache_pid, SIGUSR1); 104 kill(s->cache_pid, SIGUSR1);
105 #endif 105 #endif
106 } 106 }
107 107
108 static void cache_stats(cache_vars_t *s)
109 {
110 int newb=s->max_filepos-s->read_filepos; // new bytes in the buffer
111 mp_msg(MSGT_CACHE,MSGL_INFO,"0x%06X [0x%06X] 0x%06X ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos);
112 mp_msg(MSGT_CACHE,MSGL_INFO,"%3d %% (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size);
113 }
114
115 static int cache_read(cache_vars_t *s, unsigned char *buf, int size) 108 static int cache_read(cache_vars_t *s, unsigned char *buf, int size)
116 { 109 {
117 int total=0; 110 int total=0;
118 int sleep_count = 0; 111 int sleep_count = 0;
119 int last_max = s->max_filepos; 112 int last_max = s->max_filepos;
388 sa.sa_handler = SIG_IGN; 381 sa.sa_handler = SIG_IGN;
389 sigaction(SIGUSR1, &sa, NULL); 382 sigaction(SIGUSR1, &sa, NULL);
390 #endif 383 #endif
391 } else 384 } else
392 sleep_count = 0; 385 sleep_count = 0;
393 // cache_stats(s->cache_data);
394 } while (cache_execute_control(s)); 386 } while (cache_execute_control(s));
395 } 387 }
396 388
397 /** 389 /**
398 * \return 1 on success, 0 if the function was interrupted and -1 on error 390 * \return 1 on success, 0 if the function was interrupted and -1 on error
500 int cache_stream_fill_buffer(stream_t *s){ 492 int cache_stream_fill_buffer(stream_t *s){
501 int len; 493 int len;
502 int sector_size; 494 int sector_size;
503 if(!s->cache_pid) return stream_fill_buffer(s); 495 if(!s->cache_pid) return stream_fill_buffer(s);
504 496
505 // cache_stats(s->cache_data);
506
507 if(s->pos!=((cache_vars_t*)s->cache_data)->read_filepos) mp_msg(MSGT_CACHE,MSGL_ERR,"!!! read_filepos differs!!! report this bug...\n"); 497 if(s->pos!=((cache_vars_t*)s->cache_data)->read_filepos) mp_msg(MSGT_CACHE,MSGL_ERR,"!!! read_filepos differs!!! report this bug...\n");
508 sector_size = ((cache_vars_t*)s->cache_data)->sector_size; 498 sector_size = ((cache_vars_t*)s->cache_data)->sector_size;
509 if (sector_size > STREAM_MAX_SECTOR_SIZE) { 499 if (sector_size > STREAM_MAX_SECTOR_SIZE) {
510 mp_msg(MSGT_CACHE, MSGL_ERR, "Sector size %i larger than maximum %i\n", sector_size, STREAM_MAX_SECTOR_SIZE); 500 mp_msg(MSGT_CACHE, MSGL_ERR, "Sector size %i larger than maximum %i\n", sector_size, STREAM_MAX_SECTOR_SIZE);
511 sector_size = STREAM_MAX_SECTOR_SIZE; 501 sector_size = STREAM_MAX_SECTOR_SIZE;