Equalizer: Prevent circular application of presets

This prevents the apply presets function from resaving the preset number
and retriggering itself repeatedly, which would cause a crash.

Fixes #223

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-01-29 17:27:10 -08:00
parent e695e36599
commit abffadef4e
1 changed files with 4 additions and 0 deletions

View File

@ -715,6 +715,10 @@ void equalizerApplyPreset(AudioUnit au, NSDictionary * preset) {
{
NSInteger index = [sender indexOfSelectedItem];
// Prevent circular application
if (index == [[[NSUserDefaultsController sharedUserDefaultsController] defaults] integerForKey:@"GraphicEQpreset"])
return;
if (index < [equalizer_presets_processed count])
{
NSDictionary * preset = [equalizer_presets_processed objectAtIndex:index];