[Android] VLCOptions: enable SoXR resampler on decent devices
Thomas Guillem
git at videolan.org
Tue Nov 3 16:26:52 CET 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov 3 15:57:15 2015 +0100| [9f5a56d03ea04ef386e3557c8995a3afc3129850] | committer: Thomas Guillem
VLCOptions: enable SoXR resampler on decent devices
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=9f5a56d03ea04ef386e3557c8995a3afc3129850
---
vlc-android/src/org/videolan/vlc/util/VLCOptions.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index 70afae7..9e7e596 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -91,6 +91,8 @@ public class VLCOptions {
options.add("--network-caching=" + networkCaching);
options.add("--androidwindow-chroma");
options.add(chroma != null ? chroma : "RV32");
+ options.add("--audio-resampler");
+ options.add(getResampler());
options.add(verboseMode ? "-vvv" : "-vv");
return options;
@@ -136,6 +138,11 @@ public class VLCOptions {
return ret;
}
+ private static String getResampler() {
+ final VLCUtil.MachineSpecs m = VLCUtil.getMachineSpecs();
+ return m.processors > 2 ? "soxr" : "ugly";
+ }
+
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;
More information about the Android
mailing list