[Android] [PATCH] benchmark: block fast seek option
Duncan McNamara
dcn.mcnamara at gmail.com
Wed Aug 1 16:49:02 CEST 2018
---
.../src/org/videolan/medialibrary/media/MediaWrapper.java | 1 +
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 1 +
vlc-android/src/org/videolan/vlc/util/VLCOptions.java | 3 ++-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java b/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java
index 16097404c..80490f7f4 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/MediaWrapper.java
@@ -54,6 +54,7 @@ public class MediaWrapper extends MediaLibraryItem implements Parcelable {
public final static int MEDIA_NO_HWACCEL = 0x02;
public final static int MEDIA_PAUSED = 0x4;
public final static int MEDIA_FORCE_AUDIO = 0x8;
+ public final static int MEDIA_BENCHMARK = 0x10;
//MetaData flags
public final static int META_RATING = 1;
diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 96eeab756..3230b0413 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -260,6 +260,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val isVideoPlaying = mw.type == MediaWrapper.TYPE_VIDEO && player.isVideoPlaying()
if (!videoBackground && isVideoPlaying) mw.addFlags(MediaWrapper.MEDIA_VIDEO)
if (videoBackground) mw.addFlags(MediaWrapper.MEDIA_FORCE_AUDIO)
+ if (isBenchmark) mw.addFlags(MediaWrapper.MEDIA_BENCHMARK)
parsed = false
player.switchToVideo = false
if (TextUtils.equals(mw.uri.scheme, "content")) MediaUtils.retrieveMediaTitle(mw)
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index d882c10bb..3ec2badbf 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -213,6 +213,7 @@ public class VLCOptions {
public static void setMediaOptions(Media media, Context context, int flags) {
boolean noHardwareAcceleration = (flags & MediaWrapper.MEDIA_NO_HWACCEL) != 0;
boolean noVideo = (flags & MediaWrapper.MEDIA_VIDEO) == 0;
+ boolean benchmark = (flags & MediaWrapper.MEDIA_BENCHMARK) != 0;
final boolean paused = (flags & MediaWrapper.MEDIA_PAUSED) != 0;
int hardwareAcceleration = HW_ACCELERATION_DISABLED;
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
@@ -235,7 +236,7 @@ public class VLCOptions {
if (noVideo) media.addOption(":no-video");
if (paused) media.addOption(":start-paused");
if (!prefs.getBoolean("subtitles_autoload", true)) media.addOption(":sub-language=none");
- if (prefs.getBoolean("media_fast_seek", true)) media.addOption(":input-fast-seek");
+ if (!benchmark && prefs.getBoolean("media_fast_seek", true)) media.addOption(":input-fast-seek");
if (RendererDelegate.INSTANCE.hasRenderer()) {
media.addOption(":sout-chromecast-audio-passthrough="+prefs.getBoolean("casting_passthrough", true));
--
2.18.0
More information about the Android
mailing list