[Android] video: use length stored in the database if vlc doesn't have it yet

Sébastien Toque git at videolan.org
Fri Sep 6 21:12:59 CEST 2013


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Fri Sep  6 17:06:55 2013 +0200| [f983438e342d1904a0f9be24f112eefd6fec34d2] | committer: Sébastien Toque

video: use length stored in the database if vlc doesn't have it yet

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       |    5 +++++
 1 file changed, 5 insertions(+)

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 40aa1ce..b752227 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1383,6 +1383,11 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         }
         int time = (int) mLibVLC.getTime();
         int length = (int) mLibVLC.getLength();
+        if (length == 0) {
+            Media media = MediaDatabase.getInstance(this).getMedia(this, mLocation);
+            if (media != null)
+                length = (int) media.getLength();
+        }
 
         // Update all view elements
         mControls.setSeekable(length > 0);



More information about the Android mailing list