[Android] Don't preparse Media

Thomas Guillem git at videolan.org
Wed Jul 1 15:34:55 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul  1 15:34:49 2015 +0200| [664ed91bbb2aefa728d0fd91504be5204c0709df] | committer: Thomas Guillem

Don't preparse Media

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java             |    5 +----
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       |    5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index cfbe0ac..da31a1a 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1413,10 +1413,7 @@ public class PlaybackService extends Service {
                     continue;
                 }
                 Log.v(TAG, "Creating on-the-fly Media object for " + location);
-                final Media media = new Media(LibVLC(), Uri.parse(location));
-                media.parse(); // FIXME: parse should be done asynchronously
-                media.release();
-                mediaWrapper = new MediaWrapper(media);
+                mediaWrapper = new MediaWrapper(Uri.parse(location));
             }
             mediaList.add(mediaWrapper);
         }
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index ec168a5..a743dd9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2559,10 +2559,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 mService.restartMediaPlayer();
             }
             if (savedIndexPosition == -1 && mUri != null) {
-                final Media media = new Media(LibVLC(), mUri);
-                media.parse(); // FIXME: parse shouldn't be done asynchronously
-                media.release();
-                mService.load(new MediaWrapper(media));
+                mService.load(new MediaWrapper(mUri));
                 savedIndexPosition = mService.getCurrentMediaPosition();
             }
         }



More information about the Android mailing list