[Android] LibVLC: Media: use OMX codec only if forced

Thomas Guillem git at videolan.org
Wed Sep 14 16:45:16 CEST 2016


vlc-android | branch: 2.0.x | Thomas Guillem <thomas at gllm.fr> | Wed Sep 14 16:43:42 2016 +0200| [eb675e40a3e98332ea4d301659d67ed013e979c2] | committer: Thomas Guillem

LibVLC: Media: use OMX codec only if forced

Since this vlc module is still way more unstable than MediaCodec.

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

 libvlc/src/org/videolan/libvlc/Media.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index e336690..520b35c 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -703,12 +703,10 @@ public class Media extends VLCObject<Media.Event> {
         addOption(":network-caching=1500");
 
         final StringBuilder sb = new StringBuilder(":codec=");
-        if (decoder == HWDecoderUtil.Decoder.MEDIACODEC)
+        if (decoder == HWDecoderUtil.Decoder.MEDIACODEC || decoder == HWDecoderUtil.Decoder.ALL)
             sb.append(getMediaCodecModule()).append(",");
-        else if (decoder == HWDecoderUtil.Decoder.OMX)
+        if (force && (decoder == HWDecoderUtil.Decoder.OMX || decoder == HWDecoderUtil.Decoder.ALL))
             sb.append("iomx,");
-        else
-            sb.append(getMediaCodecModule()).append(",iomx,");
         sb.append("all");
 
         addOption(sb.toString());



More information about the Android mailing list