Commit 8a341b03 authored by David Fuhrmann's avatar David Fuhrmann Committed by Felix Paul Kühne

macosx: video effects: simplify restoring video-filter and sub-source

(cherry picked from commit 677511e79bdc42bddec1b57977973b2489772099)
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent df0f9924
...@@ -586,14 +586,6 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -586,14 +586,6 @@ static VLCVideoEffects *_o_sharedInstance = nil;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSUInteger selectedProfile = [o_profile_pop indexOfSelectedItem]; NSUInteger selectedProfile = [o_profile_pop indexOfSelectedItem];
/* disable all current video filters, if a vout is available */
vout_thread_t *p_vout = getVout();
if (p_vout) {
var_SetString(p_vout, "video-filter", "");
var_SetString(p_vout, "sub-source", "");
vlc_object_release(p_vout);
}
/* fetch preset */ /* fetch preset */
NSArray *items = [[[defaults objectForKey:@"VideoEffectProfiles"] objectAtIndex:selectedProfile] componentsSeparatedByString:@";"]; NSArray *items = [[[defaults objectForKey:@"VideoEffectProfiles"] objectAtIndex:selectedProfile] componentsSeparatedByString:@";"];
...@@ -606,26 +598,23 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -606,26 +598,23 @@ static VLCVideoEffects *_o_sharedInstance = nil;
/* filter handling */ /* filter handling */
NSString *tempString = B64DecNSStr([items objectAtIndex:0]); NSString *tempString = B64DecNSStr([items objectAtIndex:0]);
NSArray *tempArray; vout_thread_t *p_vout = getVout();
NSUInteger count;
/* enable the new filters */ /* enable the new filters */
config_PutPsz(p_intf, "video-filter", ""); config_PutPsz(p_intf, "video-filter", [tempString UTF8String]);
if ([tempString length] > 0) { if (p_vout) {
tempArray = [tempString componentsSeparatedByString:@":"]; var_SetString(p_vout, "video-filter", [tempString UTF8String]);
count = [tempArray count];
for (NSUInteger x = 0; x < count; x++)
[vci_si setVideoFilter:[[tempArray objectAtIndex:x] UTF8String] on:YES];
} }
tempString = B64DecNSStr([items objectAtIndex:1]); tempString = B64DecNSStr([items objectAtIndex:1]);
/* enable another round of new filters */ /* enable another round of new filters */
config_PutPsz(p_intf,"sub-source", ""); config_PutPsz(p_intf, "sub-source", [tempString UTF8String]);
if ([tempString length] > 0) { if (p_vout) {
tempArray = [tempString componentsSeparatedByString:@":"]; var_SetString(p_vout, "sub-source", [tempString UTF8String]);
count = [tempArray count]; }
for (NSUInteger x = 0; x < count; x++)
[vci_si setVideoFilter:[[tempArray objectAtIndex:x] UTF8String] on:YES]; if (p_vout) {
vlc_object_release(p_vout);
} }
tempString = B64DecNSStr([items objectAtIndex:2]); tempString = B64DecNSStr([items objectAtIndex:2]);
......
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