[Android] Update type names to match Medialibrary API change

Geoffrey Métais git at videolan.org
Tue Dec 20 11:12:43 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 20 11:11:44 2016 +0100| [3081f204b58ce7d53b46576d64e75fc75b411c70] | committer: Geoffrey Métais

Update type names to match Medialibrary API change

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

 medialibrary/jni/AndroidMediaLibrary.cpp | 8 ++++----
 medialibrary/jni/utils.cpp               | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index 8fee451..c0229bb 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -376,8 +376,8 @@ AndroidMediaLibrary::onMediaAdded( std::vector<medialibrary::MediaPtr> mediaList
             index = -1;
             for (medialibrary::MediaPtr const& media : mediaList) {
                 medialibrary::IMedia::Type type = media->type();
-                if (!((type == medialibrary::IMedia::Type::AudioType && m_mediaAddedType & FLAG_MEDIA_ADDED_AUDIO) ||
-                        (type == medialibrary::IMedia::Type::VideoType && m_mediaAddedType & FLAG_MEDIA_ADDED_VIDEO)))
+                if (!((type == medialibrary::IMedia::Type::Audio && m_mediaAddedType & FLAG_MEDIA_ADDED_AUDIO) ||
+                        (type == medialibrary::IMedia::Type::Video && m_mediaAddedType & FLAG_MEDIA_ADDED_VIDEO)))
                     continue;
                 jobject item = mediaToMediaWrapper(env, p_fields, media);
                 env->SetObjectArrayElement(mediaRefs, ++index, item);
@@ -418,8 +418,8 @@ void AndroidMediaLibrary::onMediaUpdated( std::vector<medialibrary::MediaPtr> me
             index = -1;
             for (medialibrary::MediaPtr const& media : mediaList) {
                 medialibrary::IMedia::Type type = media->type();
-                if (!((type == medialibrary::IMedia::Type::AudioType && m_mediaUpdatedType & FLAG_MEDIA_UPDATED_AUDIO) ||
-                        (type == medialibrary::IMedia::Type::VideoType && m_mediaUpdatedType & FLAG_MEDIA_UPDATED_VIDEO)))
+                if (!((type == medialibrary::IMedia::Type::Audio && m_mediaUpdatedType & FLAG_MEDIA_UPDATED_AUDIO) ||
+                        (type == medialibrary::IMedia::Type::Video && m_mediaUpdatedType & FLAG_MEDIA_UPDATED_VIDEO)))
                     continue;
                 jobject item = mediaToMediaWrapper(env, p_fields, media);
                 env->SetObjectArrayElement(mediaRefs, ++index, item);
diff --git a/medialibrary/jni/utils.cpp b/medialibrary/jni/utils.cpp
index 097684b..f791b05 100644
--- a/medialibrary/jni/utils.cpp
+++ b/medialibrary/jni/utils.cpp
@@ -21,10 +21,10 @@ mediaToMediaWrapper(JNIEnv* env, fields *fields, medialibrary::MediaPtr const& m
     //TODO get track, audio & spu track numbers
     jint type;
     switch (mediaPtr->type()) {
-    case medialibrary::IMedia::Type::AudioType:
+    case medialibrary::IMedia::Type::Audio:
         type = 1; //MediaWrapper.TYPE_AUDIO
         break;
-    case medialibrary::IMedia::Type::VideoType:
+    case medialibrary::IMedia::Type::Video:
         type = 0; //MediaWrapper.TYPE_VIDEO
         break;
     default:



More information about the Android mailing list