Commit 91eb796a authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed caching preferences (refs #5994)

also includes a minor fix to make room for the wordy German l10n
(cherry picked from commit 9892a1ce)
parent 6495e042
......@@ -603,24 +603,20 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100];
[[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200];
[[o_input_cachelevel_pop itemAtIndex: 3] setTag: 300];
[[o_input_cachelevel_pop itemAtIndex: 4] setTag: 400];
[[o_input_cachelevel_pop itemAtIndex: 5] setTag: 500];
[[o_input_cachelevel_pop itemAtIndex: 4] setTag: 500];
[[o_input_cachelevel_pop itemAtIndex: 5] setTag: 1000];
#define TestCaC( name ) \
#define TestCaC( name, factor ) \
b_cache_equal = b_cache_equal && \
( i_cache == config_GetInt( p_intf, name ) )
#define TestCaCi( name, int ) \
b_cache_equal = b_cache_equal && \
( ( i_cache * int ) == config_GetInt( p_intf, name ) )
( i_cache * factor == config_GetInt( p_intf, name ) );
/* Select the accurate value of the PopupButton */
bool b_cache_equal = true;
int i_cache = config_GetInt( p_intf, "file-caching");
TestCaC( "network-caching" );
TestCaC( "disc-caching" );
TestCaC( "live-caching" );
TestCaC( "network-caching", 10/3 );
TestCaC( "disc-caching", 1 );
TestCaC( "live-caching", 1 );
if( b_cache_equal )
{
[o_input_cachelevel_pop selectItemWithTag: i_cache];
......@@ -631,6 +627,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[o_input_cachelevel_pop selectItemWithTitle: _NS("Custom")];
[o_input_cachelevel_custom_txt setHidden: NO];
}
#undef TestCaC
/*********************
* subtitle settings *
......@@ -927,8 +924,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
config_PutInt( p_intf, "mkv-preload-local-dir", [o_input_mkv_preload_dir_ckb state] );
#define CaCi( name, int ) config_PutInt( p_intf, name, int * [[o_input_cachelevel_pop selectedItem] tag] )
#define CaC( name ) CaCi( name, 1 )
#define CaC( name, factor ) config_PutInt( p_intf, name, [[o_input_cachelevel_pop selectedItem] tag] * factor )
if ( [[o_input_cachelevel_pop selectedItem] tag] == 0 )
{
msg_Dbg( p_intf, "Custom chosen, not adjusting cache values" );
......@@ -936,11 +932,12 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
else
{
msg_Dbg( p_intf, "Adjusting all cache values to: %i", (int)[[o_input_cachelevel_pop selectedItem] tag] );
CaC( "file-caching" );
CaC( "network-caching" );
CaC( "disc-caching" );
CaC( "live-caching" );
CaC( "file-caching", 1 );
CaC( "network-caching", 10/3 );
CaC( "disc-caching", 1 );
CaC( "live-caching", 1 );
}
#undef CaC
b_inputSettingChanged = NO;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment