mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 17:39:38 +00:00
cache (buzeralas)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8285 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
3864cbc102
commit
4c89b52ee4
@ -39,6 +39,9 @@ float gtkAOExtraStereoMul = 1.0;
|
||||
char * gtkAOOSSMixer;
|
||||
char * gtkAOOSSDevice;
|
||||
|
||||
int gtkCacheOn = 0;
|
||||
int gtkCacheSize = 2048;
|
||||
|
||||
#ifdef HAVE_DXR3
|
||||
char * gtkDXR3Device;
|
||||
#endif
|
||||
@ -107,7 +110,9 @@ static config_t gui_opts[] =
|
||||
{ "font_autoscale",&subtitle_autoscale,CONF_TYPE_INT,CONF_RANGE,0,3,NULL },
|
||||
#endif
|
||||
|
||||
{ "cache",&stream_cache_size,CONF_TYPE_INT,CONF_RANGE,-1,65535,NULL },
|
||||
{ "cache",>kCacheOn,CONF_TYPE_INT,CONF_RANGE,-1,65535,NULL },
|
||||
{ "cache_size",>kCacheSize,CONF_TYPE_INT,CONF_RANGE,-1,65535,NULL },
|
||||
|
||||
{ "load_fullscreen",>kLoadFullscreen,CONF_TYPE_FLAG,0,0,1,NULL },
|
||||
|
||||
{ "gui_skin",&skinName,CONF_TYPE_STRING,0,0,0,NULL },
|
||||
|
@ -17,6 +17,9 @@ extern char * gtkAOOSSMixer;
|
||||
extern char * gtkAOOSSDevice;
|
||||
extern char * gtkDXR3Device;
|
||||
|
||||
extern int gtkCacheOn;
|
||||
extern int gtkCacheSize;
|
||||
|
||||
extern int gtkSubDumpMPSub;
|
||||
extern int gtkSubDumpSrt;
|
||||
|
||||
|
@ -77,6 +77,12 @@ char * gstrdup( char * str )
|
||||
return strdup( str );
|
||||
}
|
||||
|
||||
char * gstrchr( char * str,int c )
|
||||
{
|
||||
if ( !str ) return NULL;
|
||||
return strchr( str,c );
|
||||
}
|
||||
|
||||
void gfree( void ** p )
|
||||
{
|
||||
if ( *p == NULL ) return;
|
||||
@ -542,6 +548,9 @@ int guiGetEvent( int type,char * arg )
|
||||
if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) btnSet( evSetMoviePosition,1 );
|
||||
else btnSet( evSetMoviePosition,0 );
|
||||
|
||||
if ( gtkCacheOn ) stream_cache_size=gtkCacheSize;
|
||||
else stream_cache_size=-1;
|
||||
|
||||
// -- audio
|
||||
if ( audio_out )
|
||||
{
|
||||
|
@ -193,6 +193,7 @@ extern char * gstrdup( char * str );
|
||||
extern int gstrcmp( char * a,char * b );
|
||||
extern void gfree( void ** p );
|
||||
extern void gaddlist( char *** list,char * entry );
|
||||
extern char * gstrchr( char * str,int c );
|
||||
|
||||
#define guiSetFilename( s,n ) { gfree( (void **)&s ); s=gstrdup( n ); }
|
||||
|
||||
|
@ -177,9 +177,10 @@ void ShowPreferences( void )
|
||||
if ( audio_driver_list )
|
||||
{
|
||||
char * name = gstrdup( audio_driver_list[0] );
|
||||
char * sep = strchr( audio_driver_list[0],':' );
|
||||
char * sep = gstrchr( audio_driver_list[0],':' );
|
||||
if ( sep ) *sep=0;
|
||||
if ( !gstrcmp( name,(char *)info->short_name ) ) old_audio_driver=i - 1;
|
||||
free( name );
|
||||
}
|
||||
tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp );
|
||||
}
|
||||
@ -311,11 +312,9 @@ void ShowPreferences( void )
|
||||
}
|
||||
|
||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),0 );
|
||||
if ( stream_cache_size > 0 )
|
||||
{
|
||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),1 );
|
||||
gtk_adjustment_set_value( SBCacheadj,(float)stream_cache_size );
|
||||
} else gtk_widget_set_sensitive( SBCache,FALSE );
|
||||
gtk_adjustment_set_value( SBCacheadj,(float)gtkCacheSize );
|
||||
if ( !gtkCacheOn ) gtk_widget_set_sensitive( SBCache,FALSE );
|
||||
else gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),1 );
|
||||
|
||||
// -- disables
|
||||
#ifndef USE_SUB
|
||||
@ -479,8 +478,8 @@ void prButton( GtkButton * button,gpointer user_data )
|
||||
gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) );
|
||||
gtkSet( gtkSetAutoq,HSPPQualityadj->value,NULL );
|
||||
|
||||
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) stream_cache_size=(int)SBCacheadj->value;
|
||||
else stream_cache_size=-1;
|
||||
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=1; }
|
||||
else gtkCacheOn=0;
|
||||
|
||||
{
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user