[Android] Revert "Media: disable file/network caching hack for MediaCodec"

Thomas Guillem git at videolan.org
Thu Feb 25 12:29:15 CET 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 25 12:28:35 2016 +0100| [5508e9469ed0453c4ca7edd9fe2085d1aabc040c] | committer: Thomas Guillem

Revert "Media: disable file/network caching hack for MediaCodec"

This reverts commit 4078d1bc37f3d911cbed2761a294b8b7c3c40b9c.

It's still needed by (very) few samples.

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

 libvlc/src/org/videolan/libvlc/Media.java | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index 764945e..64653ff 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -21,7 +21,6 @@
 package org.videolan.libvlc;
 
 import android.net.Uri;
-import android.util.Log;
 
 import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.libvlc.util.HWDecoderUtil;
@@ -636,20 +635,17 @@ public class Media extends VLCObject<Media.Event> {
             return;
         }
 
-        if (!AndroidUtil.isJellyBeanOrLater()) {
-            /*
-             * Set higher caching values if using iomx decoding, since some omx
-             * decoders have a very high latency, and if the preroll data isn't
-             * enough to make the decoder output a frame, the playback timing gets
-             * started too soon, and every decoded frame appears to be too late.
-             * On Nexus One, the decoder latency seems to be 25 input packets
-             * for 320x170 H.264, a few packets less on higher resolutions.
-             * On Nexus S, the decoder latency seems to be about 7 packets.
-             */
-            addOption(":file-caching=1500");
-            addOption(":network-caching=1500");
-            Log.i(TAG, "file/network caching for hw decoders");
-        }
+        /*
+         * Set higher caching values if using iomx decoding, since some omx
+         * decoders have a very high latency, and if the preroll data isn't
+         * enough to make the decoder output a frame, the playback timing gets
+         * started too soon, and every decoded frame appears to be too late.
+         * On Nexus One, the decoder latency seems to be 25 input packets
+         * for 320x170 H.264, a few packets less on higher resolutions.
+         * On Nexus S, the decoder latency seems to be about 7 packets.
+         */
+        addOption(":file-caching=1500");
+        addOption(":network-caching=1500");
 
         final StringBuilder sb = new StringBuilder(":codec=");
         if (decoder == HWDecoderUtil.Decoder.MEDIACODEC)



More information about the Android mailing list