Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 55936 | Differences between
and this patch

Collapse All | Expand All

(-)MPlayer-1.0pre4.orig/cfg-common.h (-1 / +3 lines)
Lines 10-17 Link Here
10
// ------------------------- stream options --------------------
10
// ------------------------- stream options --------------------
11
11
12
#ifdef USE_STREAM_CACHE
12
#ifdef USE_STREAM_CACHE
13
	{"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 4, 65536, NULL},
13
	{"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 4, 262144, NULL},
14
	{"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL},
14
	{"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL},
15
	{"cache_min", &stream_cache_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL},
16
	{"cache_prefill", &stream_cache_prefill_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL},
15
#else
17
#else
16
	{"cache", "MPlayer was compiled WITHOUT cache2 support\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
18
	{"cache", "MPlayer was compiled WITHOUT cache2 support\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
17
#endif
19
#endif
(-)MPlayer-1.0pre4.orig/etc/example.conf (-1 / +3 lines)
Lines 116-121 Link Here
116
			# etc)
116
			# etc)
117
117
118
cache		= 8192	# use 8Mb input cache by default
118
cache		= 8192	# use 8Mb input cache by default
119
cache_min	= 20.0  # Prefill 20% of the cache before initially playing
120
cache_prefill	= 5.0   # Prefill 5% of the cache before restarting playback if it empties
119
121
120
# slang		= en	# DVD : display english subtitles if available
122
# slang		= en	# DVD : display english subtitles if available
121
# alang		= en	# DVD : play english audio tracks if available
123
# alang		= en	# DVD : play english audio tracks if available
Lines 133-136 Link Here
133
## Delete this default :)
135
## Delete this default :)
134
##
136
##
135
137
136
include = /home/gabucino/.mplayer/i_did_not_RTFM_carefully_enough...
138
#include = /home/gabucino/.mplayer/i_did_not_RTFM_carefully_enough...
(-)MPlayer-1.0pre4.orig/libmpdemux/cache2.c (-1 / +3 lines)
Lines 33-38 Link Here
33
int stream_fill_buffer(stream_t *s);
33
int stream_fill_buffer(stream_t *s);
34
int stream_seek_long(stream_t *s,off_t pos);
34
int stream_seek_long(stream_t *s,off_t pos);
35
35
36
extern float stream_cache_min_percent;
37
extern float stream_cache_prefill_percent;
36
extern int mp_input_check_interrupt(int time);
38
extern int mp_input_check_interrupt(int time);
37
39
38
typedef struct {
40
typedef struct {
Lines 207-213 Link Here
207
#endif
209
#endif
208
  s->fill_limit=8*sector;
210
  s->fill_limit=8*sector;
209
  s->back_size=size/2;
211
  s->back_size=size/2;
210
  s->prefill=size/20; // default: 5%
212
  s->prefill=size * stream_cache_prefill_percent / 100.0;
211
  return s;
213
  return s;
212
}
214
}
213
215
(-)MPlayer-1.0pre4.orig/libmpdemux/demuxer.c (-2 / +5 lines)
Lines 1374-1379 Link Here
1374
1374
1375
extern int hr_mp3_seek;
1375
extern int hr_mp3_seek;
1376
1376
1377
extern float stream_cache_min_percent;
1378
extern float stream_cache_prefill_percent;
1379
1377
demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id,char* filename){
1380
demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id,char* filename){
1378
  stream_t *as = NULL,*ss = NULL;
1381
  stream_t *as = NULL,*ss = NULL;
1379
  demuxer_t *vd,*ad = NULL,*sd = NULL;
1382
  demuxer_t *vd,*ad = NULL,*sd = NULL;
Lines 1386-1393 Link Here
1386
      return NULL;
1389
      return NULL;
1387
    }
1390
    }
1388
    if(audio_stream_cache) {
1391
    if(audio_stream_cache) {
1389
      if(!stream_enable_cache(as,audio_stream_cache*1024,audio_stream_cache*1024/5,
1392
      if(!stream_enable_cache(as,audio_stream_cache*1024,audio_stream_cache*1024*(stream_cache_min_percent / 100.0),
1390
			      audio_stream_cache*1024/20)) {
1393
			      audio_stream_cache*1024*(stream_cache_prefill_percent / 100.0))) {
1391
	free_stream(as);
1394
	free_stream(as);
1392
	mp_msg(MSGT_DEMUXER,MSGL_ERR,"Can't enable audio stream cache\n");
1395
	mp_msg(MSGT_DEMUXER,MSGL_ERR,"Can't enable audio stream cache\n");
1393
	return NULL;
1396
	return NULL;
(-)MPlayer-1.0pre4.orig/mencoder.c (+3 lines)
Lines 100-105 Link Here
100
int stream_cache_size=-1;
100
int stream_cache_size=-1;
101
#ifdef USE_STREAM_CACHE
101
#ifdef USE_STREAM_CACHE
102
extern int cache_fill_status;
102
extern int cache_fill_status;
103
104
float stream_cache_min_percent=20.0;
105
float stream_cache_prefill_percent=5.0;
103
#else
106
#else
104
#define cache_fill_status 0
107
#define cache_fill_status 0
105
#endif
108
#endif
(-)MPlayer-1.0pre4.orig/mplayer.c (-1 / +4 lines)
Lines 249-254 Link Here
249
       int stream_cache_size=-1;
249
       int stream_cache_size=-1;
250
#ifdef USE_STREAM_CACHE
250
#ifdef USE_STREAM_CACHE
251
extern int cache_fill_status;
251
extern int cache_fill_status;
252
253
float stream_cache_min_percent=20.0;
254
float stream_cache_prefill_percent=5.0;
252
#else
255
#else
253
#define cache_fill_status 0
256
#define cache_fill_status 0
254
#endif
257
#endif
Lines 1368-1374 Link Here
1368
#endif
1371
#endif
1369
if(stream_cache_size>0){
1372
if(stream_cache_size>0){
1370
  current_module="enable_cache";
1373
  current_module="enable_cache";
1371
  if(!stream_enable_cache(stream,stream_cache_size*1024,stream_cache_size*1024/5,stream_cache_size*1024/20))
1374
  if(!stream_enable_cache(stream,stream_cache_size*1024,stream_cache_size*1024*(stream_cache_min_percent / 100.0),stream_cache_size*1024*(stream_cache_prefill_percent / 100.0)))
1372
    if((eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY))) goto goto_next_file;
1375
    if((eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY))) goto goto_next_file;
1373
}
1376
}
1374
1377

Return to bug 55936