[Android] Remove obsolete calls to IAlbumTrack

Nicolas Pomepuy git at videolan.org
Thu Feb 24 10:58:19 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Nov 25 15:33:27 2021 +0100| [de36fc08790b57d84d2b231e963c595d59b05a10] | committer: Nicolas Pomepuy

Remove obsolete calls to IAlbumTrack

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

 medialibrary/jni/utils.cpp | 32 ++++++++++++++------------------
 medialibrary/jni/utils.h   |  1 -
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/medialibrary/jni/utils.cpp b/medialibrary/jni/utils.cpp
index 9a5fa11ba..74f556d79 100644
--- a/medialibrary/jni/utils.cpp
+++ b/medialibrary/jni/utils.cpp
@@ -24,29 +24,25 @@ mediaToMediaWrapper(JNIEnv* env, fields *fields, medialibrary::MediaPtr const& m
         type = -1; //MediaWrapper.TYPE_ALL
         break;
     }
-    medialibrary::AlbumTrackPtr p_albumTrack = mediaPtr->albumTrack();
     utils::jni::string artist, genre, album, albumArtist, mrl, title, thumbnail, filename;
     jint trackNumber = 0, discNumber = 0;
 
     const bool isPresent = mediaPtr->isPresent();
-    if (p_albumTrack)
-    {
-        medialibrary::ArtistPtr artistPtr = p_albumTrack->artist();
-        medialibrary::GenrePtr genrePtr = p_albumTrack->genre();
-        medialibrary::AlbumPtr albumPtr = p_albumTrack->album();
-        if (artistPtr != NULL)
-            artist = vlcNewStringUTF(env, artistPtr->name().c_str());
-        if (genrePtr != NULL)
-            genre = vlcNewStringUTF(env, genrePtr->name().c_str());
-        if (albumPtr!= NULL) {
-            album = vlcNewStringUTF(env, albumPtr->title().c_str());
-            medialibrary::ArtistPtr albumArtistPtr = albumPtr->albumArtist();
-            if (albumArtistPtr != NULL)
-                albumArtist = vlcNewStringUTF(env, albumArtistPtr->name().c_str());
-        }
-        trackNumber = p_albumTrack->trackNumber();
-        discNumber = p_albumTrack->discNumber();
+    medialibrary::ArtistPtr artistPtr = mediaPtr->artist();
+    medialibrary::GenrePtr genrePtr = mediaPtr->genre();
+    medialibrary::AlbumPtr albumPtr = mediaPtr->album();
+    if (artistPtr != NULL)
+        artist = vlcNewStringUTF(env, artistPtr->name().c_str());
+    if (genrePtr != NULL)
+        genre = vlcNewStringUTF(env, genrePtr->name().c_str());
+    if (albumPtr!= NULL) {
+        album = vlcNewStringUTF(env, albumPtr->title().c_str());
+        medialibrary::ArtistPtr albumArtistPtr = albumPtr->albumArtist();
+        if (albumArtistPtr != NULL)
+            albumArtist = vlcNewStringUTF(env, albumArtistPtr->name().c_str());
     }
+    trackNumber = mediaPtr->trackNumber();
+    discNumber = mediaPtr->discNumber();
     const medialibrary::IMetadata& metaAudioTrack = mediaPtr->metadata(medialibrary::IMedia::MetadataType::AudioTrack);
     jint  audioTrack = metaAudioTrack.isSet() ? metaAudioTrack.asInt() : -2;
     const medialibrary::IMetadata& metaSpuTrack = mediaPtr->metadata(medialibrary::IMedia::MetadataType::SubtitleTrack);
diff --git a/medialibrary/jni/utils.h b/medialibrary/jni/utils.h
index 77ccb9135..4a2f668b4 100644
--- a/medialibrary/jni/utils.h
+++ b/medialibrary/jni/utils.h
@@ -23,7 +23,6 @@
 #include <jni.h>
 #include <medialibrary/Types.h>
 #include <medialibrary/IMediaLibrary.h>
-#include <medialibrary/IAlbumTrack.h>
 #include <medialibrary/IVideoTrack.h>
 #include <medialibrary/IFile.h>
 #include <medialibrary/IMedia.h>



More information about the Android mailing list