[Android] Option to enable fast-seek
Geoffrey Métais
git at videolan.org
Thu Jan 25 09:30:26 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 25 09:27:37 2018 +0100| [e79c970bbca588a6c05cb58d77abe08859e6dd60] | committer: Geoffrey Métais
Option to enable fast-seek
> https://code.videolan.org/videolan/vlc-android/commit/e79c970bbca588a6c05cb58d77abe08859e6dd60
---
vlc-android/res/values/strings.xml | 1 +
vlc-android/res/xml/preferences_video.xml | 5 +++++
vlc-android/src/org/videolan/vlc/util/VLCOptions.java | 4 +++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index b7893e9bb..6be82e2dc 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -300,6 +300,7 @@
<string name="video_min_group_length_first">First letter only</string>
<string name="video_min_group_length_short">Short number of letters (6)</string>
<string name="video_min_group_length_long">Long number of letters (9)</string>
+ <string name="media_fast_seek">Enable experimental fast seek option</string>
<string name="media_seen">Show seen video marker</string>
<string name="media_seen_summary">Mark a video as seen when you play it until the end</string>
<string name="force_list_portrait">No grid in portrait mode</string>
diff --git a/vlc-android/res/xml/preferences_video.xml b/vlc-android/res/xml/preferences_video.xml
index bd7a88e47..1445b44d0 100644
--- a/vlc-android/res/xml/preferences_video.xml
+++ b/vlc-android/res/xml/preferences_video.xml
@@ -34,6 +34,11 @@
android:summary="@string/save_audiodelay_summary"
android:title="@string/save_audiodelay_title" />
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="media_fast_seek"
+ android:title="@string/media_fast_seek" />
+
<PreferenceCategory android:title="@string/controls_prefs_category">
<CheckBoxPreference
android:defaultValue="false"
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index c3d7650a9..c6b63762d 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -180,6 +180,7 @@ public class VLCOptions {
boolean noVideo = (flags & MediaWrapper.MEDIA_VIDEO) == 0;
final boolean paused = (flags & MediaWrapper.MEDIA_PAUSED) != 0;
int hardwareAcceleration = HW_ACCELERATION_DISABLED;
+ final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!noHardwareAcceleration) {
try {
@@ -199,7 +200,8 @@ public class VLCOptions {
if (noVideo) media.addOption(":no-video");
if (paused) media.addOption(":start-paused");
- if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("subtitles_autoload", true)) media.addOption(":sub-language=none");
+ if (!prefs.getBoolean("subtitles_autoload", true)) media.addOption(":sub-language=none");
+ if (prefs.getBoolean("media_fast_seek", false)) media.addOption(":input-fast-seek");
}
private static MediaPlayer.Equalizer getEqualizerSetFromSettings(SharedPreferences pref) {
More information about the Android
mailing list