[Android] LibVLC: speed up video track transition

Thomas Guillem git at videolan.org
Thu Jun 23 19:56:30 CEST 2016


vlc-android | branch: 2.0.x | Thomas Guillem <thomas at gllm.fr> | Thu Jun 23 19:54:53 2016 +0200| [d3a04d1cbebda73af5ab2075d51accbbedea51e5] | committer: Thomas Guillem

LibVLC: speed up video track transition

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

 libvlc/src/org/videolan/libvlc/MediaPlayer.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 145fdbd..94cb72f 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -578,6 +578,13 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
                 for (MediaPlayer.TrackDescription track : tracks) {
                     if (track.id != -1) {
                         setVideoTrack(track.id);
+                        /* HACK: flush when activating a video track. This will force an
+                         * I-Frame to be displayed right away. */
+                        if (isSeekable()) {
+                            long time = getTime();
+                            if (time > 0)
+                                setTime(time);
+                        }
                         break;
                     }
                 }



More information about the Android mailing list