[vlc-commits] medialibrary: Add a VLC_ML_IS_INDEXED control

Hugo Beauzée-Luyssen git at videolan.org
Wed Jan 23 11:05:57 CET 2019


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Nov 29 12:03:01 2018 +0100| [ab48d9e513fdea6b8c75852336b2baaafdd846a3] | committer: Hugo Beauzée-Luyssen

medialibrary: Add a VLC_ML_IS_INDEXED control

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

 include/vlc_media_library.h            | 7 +++++++
 modules/misc/medialibrary/medialib.cpp | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index a0b5d921f8..6e51b502fa 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -411,6 +411,7 @@ enum vlc_ml_control
     VLC_ML_BAN_FOLDER,              /**< arg1: mrl (const char*)  res: can't fail */
     VLC_ML_UNBAN_FOLDER,            /**< arg1: mrl (const char*)  res: can't fail */
     VLC_ML_LIST_FOLDERS,            /**< arg1: entrypoints (vlc_ml_entry_point_list_t**); res: can fail */
+    VLC_ML_IS_INDEXED,              /**< arg1: mrl (const char*) arg2 (out): bool*;       res: can fail */
     /**
      * Reload a specific folder, or all.
      * arg1: mrl (const char*), NULL to reload all folders
@@ -785,6 +786,12 @@ static inline int vlc_ml_list_folder( vlc_medialibrary_t* p_ml,
     return vlc_ml_control( p_ml, VLC_ML_LIST_FOLDERS, pp_entrypoints );
 }
 
+static inline int vlc_ml_is_indexed( vlc_medialibrary_t* p_ml,
+                                     const char* psz_mrl, bool* p_res )
+{
+    return vlc_ml_control( p_ml, VLC_ML_IS_INDEXED, psz_mrl, p_res );
+}
+
 static inline int vlc_ml_reload_folder( vlc_medialibrary_t* p_ml, const char* psz_mrl )
 {
     return vlc_ml_control( p_ml, VLC_ML_RELOAD_FOLDER, psz_mrl );
diff --git a/modules/misc/medialibrary/medialib.cpp b/modules/misc/medialibrary/medialib.cpp
index a6a8fe7099..c0b48969f1 100644
--- a/modules/misc/medialibrary/medialib.cpp
+++ b/modules/misc/medialibrary/medialib.cpp
@@ -410,6 +410,13 @@ int MediaLibrary::Control( int query, va_list args )
             *(va_arg( args, vlc_ml_entry_point_list_t**) ) = res;
             break;
         }
+        case VLC_ML_IS_INDEXED:
+        {
+            auto mrl = va_arg( args, const char* );
+            auto res = va_arg( args, bool* );
+            *res = m_ml->isIndexed( mrl );
+            break;
+        }
         case VLC_ML_RELOAD_FOLDER:
         {
             auto mrl = va_arg( args, const char* );



More information about the vlc-commits mailing list