[vlc-commits] macosx: cleanup filters config during upgrade from 2.2.x to 3.0

David Fuhrmann git at videolan.org
Wed Dec 13 23:51:28 CET 2017


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Dec 13 23:36:08 2017 +0100| [5d77b8648273617de2c516a229c5e3eeca91d96a] | committer: David Fuhrmann

macosx: cleanup filters config during upgrade from 2.2.x to 3.0

VLC 2.2.x fully controlled VLCs audio or videofilter-related config
variables with the filter dialogs and the video or audio effects
panel overwrote any changes from config with the values from the
panel.

In VLC 3.0, the config is left alone and filter parameters
are only read from the preset strings. Additionally, by default
the Default profile (with default off settings) will be loaded at
startup, to ensure that no filters accidentially stay enabled.

Therefore, for migration, from 2.2.x to 3.0 versions, lets clear
the audio-filter and video-filter variables. Users with custom
profiles still keep their settings.

close #19260

(cherry picked from commit 31140f02864e879211c3d3c8aac35ce1136046bb)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

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

 modules/gui/macosx/VLCMain+OldPrefs.m | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VLCMain+OldPrefs.m b/modules/gui/macosx/VLCMain+OldPrefs.m
index fb041485f4..7e28d17c79 100644
--- a/modules/gui/macosx/VLCMain+OldPrefs.m
+++ b/modules/gui/macosx/VLCMain+OldPrefs.m
@@ -29,6 +29,8 @@
 
 #include <unistd.h> /* execl() */
 
+#import <vlc_interface.h>
+
 @implementation VLCMain(OldPrefs)
 
 static NSString * kVLCPreferencesVersion = @"VLCPreferencesVersion";
@@ -83,11 +85,21 @@ static const int kCurrentPreferencesVersion = 4;
 
     } else if (version == 3) {
         /* version 4 (introduced in 3.0.0) adds RTL settings depending on stored language */
-
         [defaults setInteger:kCurrentPreferencesVersion forKey:kVLCPreferencesVersion];
         BOOL hasUpdated = [VLCSimplePrefsController updateRightToLeftSettings];
         [defaults synchronize];
 
+        // In VLC 2.2.x, config for filters was fully controlled by audio and video effects panel.
+        // In VLC 3.0, this is no longer the case and VLCs config is not touched anymore. Therefore,
+        // disable filter in VLCs config in this transition.
+        playlist_t *p_playlist = pl_Get(getIntf());
+        var_SetString(p_playlist, "audio-filter", "");
+        var_SetString(p_playlist, "video-filter", "");
+
+        config_PutPsz(getIntf(), "audio-filter", "");
+        config_PutPsz(getIntf(), "video-filter", "");
+        config_SaveConfigFile(getIntf());
+
         // This migration only has effect rarely, therefore only restart then
         if (!hasUpdated)
             return;



More information about the vlc-commits mailing list