vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrm...@videolan.org> | Wed Dec 13 21:46:31 2017 +0100| [8a87b3a33cb75e589e3c57ee51650c627d6839b6] | committer: David Fuhrmann
macosx: audio filters: load audio-filters variable from preset correctly Load audio filters correctly. Previously, only new filters were added, but removed filters not disabled. playlist_EnableAudioFilter ensures correct filter order in addition to modifying the audio-filters variable. As the profile string is created and changed with playlist_EnableAudioFilter, the saved string conforms to the rules, so here it can be directly loaded. Also removes redundant UI updates, which are done in a different method already. refs #19260 (cherry picked from commit 9708d49b00e20126b84895a0bffdb57ab5d26e11) Signed-off-by: David Fuhrmann <dfuhrm...@videolan.org> > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=8a87b3a33cb75e589e3c57ee51650c627d6839b6 --- .../gui/macosx/VLCAudioEffectsWindowController.m | 24 ++++------------------ 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m b/modules/gui/macosx/VLCAudioEffectsWindowController.m index 8a5ed1c7e8..50cbb2124b 100644 --- a/modules/gui/macosx/VLCAudioEffectsWindowController.m +++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m @@ -154,17 +154,10 @@ var_SetString(p_playlist, "equalizer-preset", psz_eq_preset); /* filter handling */ - NSString *tempString = B64DecNSStr([items objectAtIndex:1]); - NSArray *tempArray; - NSUInteger count; - - /* enable the new filters */ - if ([tempString length] > 0) { - tempArray = [tempString componentsSeparatedByString:@":"]; - count = [tempArray count]; - for (NSUInteger x = 0; x < count; x++) - playlist_EnableAudioFilter(p_playlist, [[tempArray objectAtIndex:x] UTF8String], true); - } + NSString *audioFilters = B64DecNSStr([items objectAtIndex:1]); + if (p_aout) + var_SetString(p_aout, "audio-filter", audioFilters.UTF8String); + var_SetString(p_playlist, "audio-filter", audioFilters.UTF8String); NSInteger presetIndex = [self getPresetIndexForProfile:profileIndex]; @@ -208,15 +201,6 @@ var_SetString(p_aout, "equalizer-preset", [[[defaults objectForKey:@"EQNames"] objectAtIndex:presetIndex] UTF8String]); } - /* update UI */ - BOOL b_equalizerEnabled = [tempString rangeOfString:@"equalizer"].location != NSNotFound; - [_equalizerView enableSubviews:b_equalizerEnabled]; - [_equalizerEnableCheckbox setState:(b_equalizerEnabled ? NSOnState : NSOffState)]; - - [_equalizerTwoPassCheckbox setState:[[items objectAtIndex:15] intValue]]; - - [defaults synchronize]; - if (p_aout) vlc_object_release(p_aout); } _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits