[Android] preferences: set a default value for chroma_format

Thomas Guillem git at videolan.org
Fri Nov 13 15:40:54 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 13 15:39:46 2015 +0100| [46adc6d0225f761e1046ec764c5d898dc479b03a] | committer: Thomas Guillem

preferences: set a default value for chroma_format

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=46adc6d0225f761e1046ec764c5d898dc479b03a
---

 vlc-android/res/values/strings.xml                    |    1 +
 vlc-android/res/xml/preferences_perf.xml              |    2 +-
 vlc-android/src/org/videolan/vlc/util/VLCOptions.java |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index e6fbb93..5c46289 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -544,6 +544,7 @@
         <item>RV16</item>
         <item>YV12</item>
     </string-array>
+    <string name="chroma_format_default" translatable="false">RV32</string>
 
     <string-array name="chroma_formats" translatable="false">
         <item>RGB 32-bit</item>
diff --git a/vlc-android/res/xml/preferences_perf.xml b/vlc-android/res/xml/preferences_perf.xml
index 2d85866..921f743 100644
--- a/vlc-android/res/xml/preferences_perf.xml
+++ b/vlc-android/res/xml/preferences_perf.xml
@@ -3,7 +3,7 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
     android:title="@string/performance_prefs_category" >
     <ListPreference
-        android:defaultValue=""
+        android:defaultValue="@string/chroma_format_default"
         android:entries="@array/chroma_formats"
         android:entryValues="@array/chroma_formats_values"
         android:key="chroma_format"
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index e1c82b0..f7bda39 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -59,7 +59,7 @@ public class VLCOptions {
         final boolean timeStreching = pref.getBoolean("enable_time_stretching_audio", timeStrechingDefault);
         final String subtitlesEncoding = pref.getString("subtitle_text_encoding", "");
         final boolean frameSkip = pref.getBoolean("enable_frame_skip", false);
-        String chroma = pref.getString("chroma_format", null);
+        String chroma = pref.getString("chroma_format", VLCApplication.getAppResources().getString(R.string.chroma_format_default));
         if (chroma != null)
             chroma = chroma.equals("YV12") && !AndroidUtil.isGingerbreadOrLater() ? "" : chroma;
         final boolean verboseMode = pref.getBoolean("enable_verbose_mode", true);



More information about the Android mailing list