[Android] Merge playback speed options, set default to true

Geoffrey Métais git at videolan.org
Wed Jun 29 16:04:26 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jun 28 10:52:08 2016 +0200| [b2b0b287b8822a13fc01de2985f5863c03685f59] | committer: Geoffrey Métais

Merge playback speed options, set default to true

(cherry picked from commit 6f8def671c9628705eec828cec913ec1d5c3fea3)

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

 vlc-android/res/values/strings.xml                                | 6 ++----
 vlc-android/res/xml/preferences_adv.xml                           | 8 +-------
 vlc-android/src/org/videolan/vlc/PlaybackService.java             | 4 ++--
 .../src/org/videolan/vlc/gui/preferences/PreferencesActivity.java | 1 -
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       | 4 ++--
 5 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 0e63111..afbd1cc 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -198,10 +198,8 @@
 
     <string name="playback_history_title">Playback history</string>
     <string name="playback_history_summary">Save all media played in History section</string>
-    <string name="playback_speed_title">Save Audio Playback Speed</string>
-    <string name="playback_speed_summary">Remember the audio playback speed you set</string>
-    <string name="save_video_speed_title">Save video Playback speed</string>
-    <string name="save_video_speed_summary">Remember the video playback speed you set</string>
+    <string name="playback_speed_title">Save Playback Speed</string>
+    <string name="playback_speed_summary">Remember the playback speed you set</string>
 
     <!-- Tips -->
     <string name="video_player_tips">Video player tips:</string>
diff --git a/vlc-android/res/xml/preferences_adv.xml b/vlc-android/res/xml/preferences_adv.xml
index be94188..429fc05 100644
--- a/vlc-android/res/xml/preferences_adv.xml
+++ b/vlc-android/res/xml/preferences_adv.xml
@@ -12,13 +12,7 @@
     <!--android:title="@string/vout" />-->
 
     <CheckBoxPreference
-        android:defaultValue="false"
-        android:key="video_playback_speed"
-        android:title="@string/save_video_speed_title"
-        android:summary="@string/save_video_speed_summary" />
-
-    <CheckBoxPreference
-        android:defaultValue="false"
+        android:defaultValue="true"
         android:key="playback_speed"
         android:summary="@string/playback_speed_summary"
         android:title="@string/playback_speed_title" />
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 4105401..9d907cc 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1746,7 +1746,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
             mMediaPlayer.setVideoTitleDisplay(MediaPlayer.Position.Disable, 0);
             changeAudioFocus(true);
             mMediaPlayer.setEventListener(mMediaPlayerListener);
-            if (!isVideoPlaying && mMediaPlayer.getRate() == 1.0F && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false))
+            if (!isVideoPlaying && mMediaPlayer.getRate() == 1.0F && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true))
                 setRate(mSettings.getFloat(PreferencesActivity.KEY_AUDIO_PLAYBACK_RATE, 1.0F), true);
             mMediaPlayer.play();
 
@@ -1953,7 +1953,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
     @MainThread
     public void setRate(float rate, boolean save) {
         mMediaPlayer.setRate(rate);
-        if (save && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false))
+        if (save && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true))
             Util.commitPreferences(mSettings.edit().putFloat(PreferencesActivity.KEY_AUDIO_PLAYBACK_RATE, rate));
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java
index cf81840..7b75cfe 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesActivity.java
@@ -43,7 +43,6 @@ public class PreferencesActivity extends AppCompatActivity implements PlaybackSe
     public final static String VIDEO_SPEED = "VideoSpeed";
     public final static String VIDEO_BACKGROUND = "video_background";
     public final static String VIDEO_RESTORE = "video_restore";
-    public final static String VIDEO_SAVE_SPEED = "video_playback_speed";
     public final static String VIDEO_RATE = "video_rate";
     public final static String AUTO_RESCAN = "auto_rescan";
     public final static String LOGIN_STORE = "store_login";
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 8634349..741efd8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -757,7 +757,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
         loadMedia();
 
-        boolean ratePref = mSettings.getBoolean(PreferencesActivity.VIDEO_SAVE_SPEED, false);
+        boolean ratePref = mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true);
         mService.setRate(ratePref ? mSettings.getFloat(PreferencesActivity.VIDEO_RATE, 1.0f) : 1.0F, false);
 
 
@@ -903,7 +903,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         }
         editor.putString(PreferencesActivity.VIDEO_SUBTITLE_FILES, subtitleList_serialized);
 
-        boolean ratePref = mSettings.getBoolean(PreferencesActivity.VIDEO_SAVE_SPEED, false);
+        boolean ratePref = mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false);
         if (ratePref)
             editor.putFloat(PreferencesActivity.VIDEO_RATE, mService.getRate());
         mService.setRate(1.0f, false);



More information about the Android mailing list