[Android] Fix prefer SMB 1 argument not set

Nicolas Pomepuy git at videolan.org
Tue Dec 15 11:12:13 CET 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Dec 15 11:08:15 2020 +0100| [215f9acf49f51bb3224780a4792fb828c447a4c1] | committer: Nicolas Pomepuy

Fix prefer SMB 1 argument not set

> https://code.videolan.org/videolan/vlc-android/commit/215f9acf49f51bb3224780a4792fb828c447a4c1
---

 .../resources/src/main/java/org/videolan/resources/VLCOptions.kt    | 3 ++-
 .../src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt     | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt b/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
index c33e1521d..46c4cbf58 100644
--- a/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
+++ b/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
@@ -131,7 +131,8 @@ object VLCOptions {
                 val optionsArray = customOptions.split("\\r?\\n".toRegex()).toTypedArray()
                 if (!optionsArray.isNullOrEmpty()) Collections.addAll(options, *optionsArray)
             }
-            options.add("--smb-force-v1")
+            if (pref.getBoolean("prefer_smbv1", true))
+                options.add("--smb-force-v1")
             if (!Settings.showTvUi) {
                 //Ambisonic
                 val hstfDir = context.getDir("vlc", Context.MODE_PRIVATE)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
index 4f30df3b3..e29948b04 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
@@ -164,10 +164,14 @@ class PreferencesAdvanced : BasePreferenceFragment(), SharedPreferences.OnShared
                 }
                 restartLibVLC()
             }
-            "opengl", "chroma_format", "deblocking", "enable_frame_skip", "enable_time_stretching_audio", "enable_verbose_mode", "prefer_smbv1" -> {
+            "opengl", "chroma_format", "deblocking", "enable_frame_skip", "enable_time_stretching_audio", "enable_verbose_mode" -> {
                 VLCInstance.restart()
                 (activity as? PreferencesActivity)?.restartMediaPlayer()
             }
+            "prefer_smbv1" -> {
+                VLCInstance.restart()
+                UiTools.restartDialog(requireActivity())
+            }
         }
     }
     fun restartLibVLC() {



More information about the Android mailing list