[Android] New constructor for MediaWrapper

Geoffrey Métais git at videolan.org
Mon Feb 9 11:30:47 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 22 18:19:36 2015 +0100| [bdf35efd26fd0ec278cf41677ef3bd9b8cc7d816] | committer: Geoffrey Métais

New constructor for MediaWrapper

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=bdf35efd26fd0ec278cf41677ef3bd9b8cc7d816
---

 vlc-android/src/org/videolan/vlc/MediaWrapper.java |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaWrapper.java b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
index 6c65e18..c3d57e3 100644
--- a/vlc-android/src/org/videolan/vlc/MediaWrapper.java
+++ b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
@@ -100,18 +100,19 @@ public class MediaWrapper implements Parcelable {
     }
 
     private void init(Media media) {
+
         mType = TYPE_ALL;
 
         if (media != null) {
-            if (media.isParsed()) {
-                mLength = media.getDuration();
+            mLength = media.getDuration();
 
+            if (media.isParsed()) {
                 for (int i = 0; i < media.getTrackCount(); ++i) {
                     final Media.Track track = media.getTrack(i);
                     if (track == null)
                         continue;
                     if (track.type == Media.Track.Type.Video) {
-                        final Media.VideoTrack videoTrack = (VideoTrack) track;
+                        final VideoTrack videoTrack = (VideoTrack) track;
                         mType = TYPE_VIDEO;
                         mWidth = videoTrack.width;
                         mHeight = videoTrack.height;



More information about the Android mailing list