vlc | branch: master | David Fuhrmann <[email protected]> | Sun Aug 31 
15:16:57 2014 +0200| [ddccf6b050412f348a00c12b857a48d4ac5e2b63] | committer: 
David Fuhrmann

macosx: video effects: only set video splitters when needed

Avoids setting this variable multiple times, as each time vout
restart is requested. Also avoids unnecessary vout restarts at
start and when changing profiles.

refs #12063

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

 modules/gui/macosx/VideoEffects.m |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/VideoEffects.m 
b/modules/gui/macosx/VideoEffects.m
index 55e7f9d..df9ac85 100644
--- a/modules/gui/macosx/VideoEffects.m
+++ b/modules/gui/macosx/VideoEffects.m
@@ -594,9 +594,6 @@ static VLCVideoEffects *_o_sharedInstance = nil;
         vlc_object_release(p_vout);
     }
 
-    // video-splitter needs to be set via playlist var
-    var_SetString(pl_Get(p_intf), "video-splitter", "");
-
     /* fetch preset */
     NSArray *items = [[[defaults objectForKey:@"VideoEffectProfiles"] 
objectAtIndex:selectedProfile] componentsSeparatedByString:@";"];
 
@@ -633,12 +630,13 @@ static VLCVideoEffects *_o_sharedInstance = nil;
 
     tempString = B64DecNSStr([items objectAtIndex:2]);
     /* enable another round of new filters */
-    config_PutPsz(p_intf,"video-splitter", "");
-    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];
+    char *psz_current_splitter = var_GetString(pl_Get(p_intf), 
"video-splitter");
+    bool b_filter_changed = ![tempString 
isEqual:toNSStr(psz_current_splitter)];
+    free(psz_current_splitter);
+
+    if (b_filter_changed) {
+        config_PutPsz(p_intf, "video-splitter", [tempString UTF8String]);
+        var_SetString(pl_Get(p_intf), "video-splitter", [tempString 
UTF8String]);
     }
 
     /* try to set filter values on-the-fly and store them appropriately */

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

Reply via email to