[Android] libvlc: Media: throw a runtime exception instead of ignoring errors

Thomas Guillem git at videolan.org
Wed May 27 17:43:44 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed May 27 17:11:44 2015 +0200| [b3082dce6bba66db31fdf4e37a0afa5f7a923518] | committer: Thomas Guillem

libvlc: Media: throw a runtime exception instead of ignoring errors

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

 libvlc/src/org/videolan/libvlc/Media.java |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index 9903580..f99b7b1 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -347,13 +347,13 @@ public final class Media extends VLCObject {
     }
 
     /**
-     * Parse the media synchronously with a flag.
+     * Parse the media synchronously with a flag. This Media should be alive (not released).
      *
      * @param flags see {@link Parse}
      * @return true in case of success, false otherwise.
      */
     public synchronized boolean parse(int flags) {
-        if (!isReleased() && (mParseStatus & (PARSE_STATUS_PARSED|PARSE_STATUS_PARSING)) == 0) {
+        if ((mParseStatus & (PARSE_STATUS_PARSED|PARSE_STATUS_PARSING)) == 0) {
             mParseStatus |= PARSE_STATUS_PARSING;
             if (nativeParse(flags)) {
                 postParse();
@@ -364,7 +364,7 @@ public final class Media extends VLCObject {
     }
 
     /**
-     * Parse the media and local art synchronously.
+     * Parse the media and local art synchronously. This Media should be alive (not released).
      *
      * @return true in case of success, false otherwise.
      */
@@ -373,7 +373,7 @@ public final class Media extends VLCObject {
     }
 
     /**
-     * Parse the media asynchronously with a flag.
+     * Parse the media asynchronously with a flag. This Media should be alive (not released).
      *
      * To track when this is over you can listen to {@link VLCObject.Events#MediaParsedChanged}
      * event (only if this methods returned true).
@@ -382,7 +382,7 @@ public final class Media extends VLCObject {
      * @return true in case of success, false otherwise.
      */
     public synchronized boolean parseAsync(int flags) {
-        if (!isReleased() && (mParseStatus & (PARSE_STATUS_PARSED|PARSE_STATUS_PARSING)) == 0) {
+        if ((mParseStatus & (PARSE_STATUS_PARSED|PARSE_STATUS_PARSING)) == 0) {
             mParseStatus |= PARSE_STATUS_PARSING;
             return nativeParseAsync(flags);
         } else
@@ -390,7 +390,7 @@ public final class Media extends VLCObject {
     }
 
     /**
-     * Parse the media and local art asynchronously.
+     * Parse the media and local art asynchronously. This Media should be alive (not released).
      *
      * @see #parseAsync(int)
      */
@@ -399,7 +399,7 @@ public final class Media extends VLCObject {
     }
 
     /**
-     * Returns true if the media is parsed
+     * Returns true if the media is parsed This Media should be alive (not released).
      */
     public synchronized boolean isParsed() {
         return (mParseStatus & PARSE_STATUS_PARSED) != 0;
@@ -470,4 +470,4 @@ public final class Media extends VLCObject {
     private native Track[] nativeGetTracks();
     private native long nativeGetDuration();
     private native int nativeGetType();
-}
+}
\ No newline at end of file



More information about the Android mailing list