Commit 15afdc9e authored by David Fuhrmann's avatar David Fuhrmann Committed by Felix Paul Kühne

macosx: fix crash when audio effects panel was opened

close #6252
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
(cherry picked from commit 73741d01)
parent ddf35356
...@@ -189,51 +189,49 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf, ...@@ -189,51 +189,49 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
{ {
vlc_object_t *p_object = VLC_OBJECT(getAout()); vlc_object_t *p_object = VLC_OBJECT(getAout());
if( p_object == NULL ) if( p_object == NULL )
p_object = VLC_OBJECT(pl_Get( VLCIntf )); p_object = vlc_object_hold(pl_Get( p_intf ));
char *psz_preset;
var_Create( p_object, "equalizer-preset", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
psz_preset = var_GetNonEmptyString( p_object, "equalizer-preset" );
if( p_object ) for( int i = 0 ; i < NB_PRESETS ; i++ )
{ {
char *psz_preset; if( strcmp( preset_list[i], psz_preset ) )
continue;
var_Create( p_object, "equalizer-preset", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); [o_eq_presets_popup selectItemWithTag:i];
psz_preset = var_GetNonEmptyString( p_object, "equalizer-preset" );
for( int i = 0 ; i < NB_PRESETS ; i++ ) [o_eq_preamp_sld setFloatValue: eqz_preset_10b[i].f_preamp];
[self setBandSlidersValues: (float *)eqz_preset_10b[i].f_amp];
if( strcmp( psz_preset, "flat" ) )
{ {
if( strcmp( preset_list[i], psz_preset ) ) char psz_bands[100];
continue;
snprintf( psz_bands, sizeof( psz_bands ),
[o_eq_presets_popup selectItemWithTag:i]; "%.1f %.1f %.1f %.1f %.1f %.1f %.1f "
"%.1f %.1f %.1f",
[o_eq_preamp_sld setFloatValue: eqz_preset_10b[i].f_preamp]; eqz_preset_10b[i].f_amp[0],
[self setBandSlidersValues: (float *)eqz_preset_10b[i].f_amp]; eqz_preset_10b[i].f_amp[1],
eqz_preset_10b[i].f_amp[2],
if( strcmp( psz_preset, "flat" ) ) eqz_preset_10b[i].f_amp[3],
{ eqz_preset_10b[i].f_amp[4],
char psz_bands[100]; eqz_preset_10b[i].f_amp[5],
eqz_preset_10b[i].f_amp[6],
snprintf( psz_bands, sizeof( psz_bands ), eqz_preset_10b[i].f_amp[7],
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f " eqz_preset_10b[i].f_amp[8],
"%.1f %.1f %.1f", eqz_preset_10b[i].f_amp[9] );
eqz_preset_10b[i].f_amp[0],
eqz_preset_10b[i].f_amp[1], var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
eqz_preset_10b[i].f_amp[2], var_Create( p_object, "equalizer-bands", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
eqz_preset_10b[i].f_amp[3], var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[i].f_preamp );
eqz_preset_10b[i].f_amp[4], var_SetString( p_object, "equalizer-bands", psz_bands );
eqz_preset_10b[i].f_amp[5],
eqz_preset_10b[i].f_amp[6],
eqz_preset_10b[i].f_amp[7],
eqz_preset_10b[i].f_amp[8],
eqz_preset_10b[i].f_amp[9] );
var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
var_Create( p_object, "equalizer-bands", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[i].f_preamp );
var_SetString( p_object, "equalizer-bands", psz_bands );
}
} }
free( psz_preset );
} }
free( psz_preset );
vlc_object_release( p_object );
[self equalizerUpdated]; [self equalizerUpdated];
} }
......
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