[Android] Set playback speed persistence default to false

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


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun 29 15:50:25 2016 +0200| [4ba41b6a7260d6b825878ea2ecaa452af1584d8e] | committer: Geoffrey Métais

Set playback speed persistence default to false

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

 vlc-android/res/xml/preferences_adv.xml                             | 2 +-
 vlc-android/src/org/videolan/vlc/PlaybackService.java               | 5 +++--
 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/vlc-android/res/xml/preferences_adv.xml b/vlc-android/res/xml/preferences_adv.xml
index 429fc05..f3e0069 100644
--- a/vlc-android/res/xml/preferences_adv.xml
+++ b/vlc-android/res/xml/preferences_adv.xml
@@ -12,7 +12,7 @@
     <!--android:title="@string/vout" />-->
 
     <CheckBoxPreference
-        android:defaultValue="true"
+        android:defaultValue="false"
         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 9d907cc..56c8a10 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -32,6 +32,7 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
 import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.media.AudioManager;
@@ -1746,7 +1747,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, true))
+            if (!isVideoPlaying && mMediaPlayer.getRate() == 1.0F && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false))
                 setRate(mSettings.getFloat(PreferencesActivity.KEY_AUDIO_PLAYBACK_RATE, 1.0F), true);
             mMediaPlayer.play();
 
@@ -1953,7 +1954,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, true))
+        if (save && mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false))
             Util.commitPreferences(mSettings.edit().putFloat(PreferencesActivity.KEY_AUDIO_PLAYBACK_RATE, rate));
     }
 
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 741efd8..54a5790 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.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, true);
+        boolean ratePref = mSettings.getBoolean(PreferencesActivity.KEY_AUDIO_PLAYBACK_SPEED_PERSIST, false);
         mService.setRate(ratePref ? mSettings.getFloat(PreferencesActivity.VIDEO_RATE, 1.0f) : 1.0F, false);
 
 



More information about the Android mailing list