vlc/vlc-2.2 | branch: master | David Fuhrmann <[email protected]> | Sun 
Aug 31 15:28:26 2014 +0200| [8a341b03d5083e5376b68b18ee9d4b96da911730] | 
committer: Felix Paul Kühne

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

(cherry picked from commit 677511e79bdc42bddec1b57977973b2489772099)
Signed-off-by: Felix Paul Kühne <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=8a341b03d5083e5376b68b18ee9d4b96da911730
---

 modules/gui/macosx/VideoEffects.m |   33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/modules/gui/macosx/VideoEffects.m 
b/modules/gui/macosx/VideoEffects.m
index df9ac85..fe1a246 100644
--- a/modules/gui/macosx/VideoEffects.m
+++ b/modules/gui/macosx/VideoEffects.m
@@ -586,14 +586,6 @@ static VLCVideoEffects *_o_sharedInstance = nil;
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     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 */
     NSArray *items = [[[defaults objectForKey:@"VideoEffectProfiles"] 
objectAtIndex:selectedProfile] componentsSeparatedByString:@";"];
 
@@ -606,26 +598,23 @@ static VLCVideoEffects *_o_sharedInstance = nil;
 
     /* filter handling */
     NSString *tempString = B64DecNSStr([items objectAtIndex:0]);
-    NSArray *tempArray;
-    NSUInteger count;
+    vout_thread_t *p_vout = getVout();
 
     /* enable the new filters */
-    config_PutPsz(p_intf, "video-filter", "");
-    if ([tempString length] > 0) {
-        tempArray = [tempString componentsSeparatedByString:@":"];
-        count = [tempArray count];
-        for (NSUInteger x = 0; x < count; x++)
-            [vci_si setVideoFilter:[[tempArray objectAtIndex:x] UTF8String] 
on:YES];
+    config_PutPsz(p_intf, "video-filter", [tempString UTF8String]);
+    if (p_vout) {
+        var_SetString(p_vout, "video-filter", [tempString UTF8String]);
     }
 
     tempString = B64DecNSStr([items objectAtIndex:1]);
     /* enable another round of new filters */
-    config_PutPsz(p_intf,"sub-source", "");
-    if ([tempString length] > 0) {
-        tempArray = [tempString componentsSeparatedByString:@":"];
-        count = [tempArray count];
-        for (NSUInteger x = 0; x < count; x++)
-            [vci_si setVideoFilter:[[tempArray objectAtIndex:x] UTF8String] 
on:YES];
+    config_PutPsz(p_intf, "sub-source", [tempString UTF8String]);
+    if (p_vout) {
+        var_SetString(p_vout, "sub-source", [tempString UTF8String]);
+    }
+
+    if (p_vout) {
+        vlc_object_release(p_vout);
     }
 
     tempString = B64DecNSStr([items objectAtIndex:2]);

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to