summaryrefslogtreecommitdiffstats
path: root/stream/cache2.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/cache2.c')
-rw-r--r--stream/cache2.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/stream/cache2.c b/stream/cache2.c
index 2e2aadc3fe..98e5d93501 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -56,7 +56,6 @@ static void *ThreadProc(void *s);
#include "stream.h"
#include "cache2.h"
-extern int use_gui;
typedef struct {
// constats:
@@ -90,15 +89,13 @@ static int min_fill=0;
int cache_fill_status=0;
-static void cache_stats(cache_vars_t *s)
-{
+static void cache_stats(cache_vars_t* s){
int newb=s->max_filepos-s->read_filepos; // new bytes in the buffer
mp_msg(MSGT_CACHE,MSGL_INFO,"0x%06X [0x%06X] 0x%06X ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos);
mp_msg(MSGT_CACHE,MSGL_INFO,"%3d %% (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size);
}
-static int cache_read(cache_vars_t *s, unsigned char *buf, int size)
-{
+static int cache_read(cache_vars_t* s,unsigned char* buf,int size){
int total=0;
while(size>0){
int pos,newb,len;
@@ -144,8 +141,7 @@ static int cache_read(cache_vars_t *s, unsigned char *buf, int size)
return total;
}
-static int cache_fill(cache_vars_t *s)
-{
+static int cache_fill(cache_vars_t* s){
int back,back2,newb,space,len,pos;
off_t read=s->read_filepos;
@@ -388,7 +384,7 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){
mp_msg(MSGT_CACHE,MSGL_V,"CACHE_PRE_INIT: %"PRId64" [%"PRId64"] %"PRId64" pre:%d eof:%d \n",
(int64_t)s->min_filepos,(int64_t)s->read_filepos,(int64_t)s->max_filepos,min,s->eof);
while(s->read_filepos<s->min_filepos || s->max_filepos-s->read_filepos<min){
- mp_msg(MSGT_CACHE,MSGL_STATUS,MSGTR_CacheFill,
+ mp_tmsg(MSGT_CACHE,MSGL_STATUS,"\rCache fill: %5.2f%% (%"PRId64" bytes) ",
100.0*(float)(s->max_filepos-s->read_filepos)/(float)(s->buffer_size),
(int64_t)s->max_filepos-s->read_filepos
);
@@ -415,9 +411,6 @@ static void ThreadProc( void *s ){
#endif
#endif
-#ifdef CONFIG_GUI
- use_gui = 0; // mp_msg may not use gui stuff in forked code
-#endif
// cache thread mainloop:
signal(SIGTERM,exit_sighandler); // kill
do {