[Android] Videogroups: Add id

Geoffrey Métais git at videolan.org
Thu Mar 26 18:07:54 CET 2020


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 26 11:10:47 2020 +0100| [2cc06993a93bcd26dc85b8044e82abec8ff7f030] | committer: Geoffrey Métais

Videogroups: Add id

> https://code.videolan.org/videolan/vlc-android/commit/2cc06993a93bcd26dc85b8044e82abec8ff7f030
---

 medialibrary/jni/medialibrary.cpp                                     | 2 +-
 medialibrary/jni/utils.cpp                                            | 2 +-
 .../src/org/videolan/medialibrary/interfaces/media/VideoGroup.java    | 4 ++--
 medialibrary/src/org/videolan/medialibrary/media/VideoGroupImpl.java  | 4 ++--
 medialibrary/src/org/videolan/medialibrary/stubs/StubVideoGroup.java  | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/medialibrary/jni/medialibrary.cpp b/medialibrary/jni/medialibrary.cpp
index 0bc848d0d..be38f068b 100644
--- a/medialibrary/jni/medialibrary.cpp
+++ b/medialibrary/jni/medialibrary.cpp
@@ -2181,7 +2181,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved)
     GET_ID(GetMethodID,
            ml_fields.VideoGroup.initID,
            ml_fields.VideoGroup.clazz,
-           "<init>", "(Ljava/lang/String;I)V");
+           "<init>", "(JLjava/lang/String;I)V");
 
     GET_ID(GetFieldID,
            ml_fields.MediaLibrary.instanceID,
diff --git a/medialibrary/jni/utils.cpp b/medialibrary/jni/utils.cpp
index 1a7b26b54..6a2cdaa51 100644
--- a/medialibrary/jni/utils.cpp
+++ b/medialibrary/jni/utils.cpp
@@ -164,7 +164,7 @@ convertVideoGroupObject(JNIEnv* env, fields *fields, medialibrary::MediaGroupPtr
 {
     jstring name = env->NewStringUTF(videogroupPtr->name().c_str());
     jobject item = env->NewObject(fields->VideoGroup.clazz, fields->VideoGroup.initID,
-                          name, (jint)videogroupPtr->nbVideo());
+                          (jlong) videogroupPtr->id(), name, (jint)videogroupPtr->nbVideo());
     env->DeleteLocalRef(name);
     return item;
 }
diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/media/VideoGroup.java b/medialibrary/src/org/videolan/medialibrary/interfaces/media/VideoGroup.java
index 49374fc01..d32efd270 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/VideoGroup.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/VideoGroup.java
@@ -12,8 +12,8 @@ public abstract class VideoGroup extends MediaLibraryItem {
 
     public int mCount;
 
-    public VideoGroup(String name, int count) {
-        super(0L, name);
+    public VideoGroup(long id, String name, int count) {
+        super(id, name);
         mCount = count;
     }
 
diff --git a/medialibrary/src/org/videolan/medialibrary/media/VideoGroupImpl.java b/medialibrary/src/org/videolan/medialibrary/media/VideoGroupImpl.java
index 1984eabc6..e9f6635ef 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/VideoGroupImpl.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/VideoGroupImpl.java
@@ -12,8 +12,8 @@ import org.videolan.medialibrary.interfaces.media.VideoGroup;
 public class VideoGroupImpl extends VideoGroup {
 
     @SuppressWarnings("unused") /* Used from JNI */
-    VideoGroupImpl(String name, int count) {
-        super(name, count);
+    VideoGroupImpl(long id, String name, int count) {
+        super(id, name, count);
     }
 
     public VideoGroupImpl(Parcel in) {
diff --git a/medialibrary/src/org/videolan/medialibrary/stubs/StubVideoGroup.java b/medialibrary/src/org/videolan/medialibrary/stubs/StubVideoGroup.java
index 1a77daeb0..63c82cb9d 100644
--- a/medialibrary/src/org/videolan/medialibrary/stubs/StubVideoGroup.java
+++ b/medialibrary/src/org/videolan/medialibrary/stubs/StubVideoGroup.java
@@ -7,7 +7,7 @@ import org.videolan.medialibrary.interfaces.media.VideoGroup;
 
 public class StubVideoGroup extends VideoGroup {
     public StubVideoGroup(String name, int count) {
-        super(name, count);
+        super(0L, name, count);
     }
 
     public StubVideoGroup(Parcel in) {



More information about the Android mailing list