[Android] VlcObject: retain return true if the object can be retained

Thomas Guillem git at videolan.org
Wed Feb 4 15:39:51 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Feb  2 18:24:00 2015 +0100| [27f1d4c89a5b10560ea57c6f95916e13065ae62a] | committer: Thomas Guillem

VlcObject: retain return true if the object can be retained

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

 libvlc/src/org/videolan/libvlc/VLCObject.java |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/VLCObject.java b/libvlc/src/org/videolan/libvlc/VLCObject.java
index 6359a3b..dc5682e 100644
--- a/libvlc/src/org/videolan/libvlc/VLCObject.java
+++ b/libvlc/src/org/videolan/libvlc/VLCObject.java
@@ -136,10 +136,14 @@ public abstract class VLCObject {
 
     /**
      * Increment internal ref count of the native object.
+     * @return true if media is retained
      */
-    public synchronized final void retain() {
-        if (mNativeRefCount > 0)
+    public synchronized final boolean retain() {
+        if (mNativeRefCount > 0) {
             mNativeRefCount++;
+            return true;
+        } else
+            return false;
     }
 
     /**



More information about the Android mailing list