[vlc-commits] medialibrary: add function to get banned entry points
Prince Gupta
git at videolan.org
Mon Mar 1 10:40:14 UTC 2021
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Tue Feb 23 15:53:59 2021 +0530| [d26d57d224763134fad88f35e8065fd9c9bfe318] | committer: Pierre Lamot
medialibrary: add function to get banned entry points
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d26d57d224763134fad88f35e8065fd9c9bfe318
---
include/vlc_media_library.h | 7 +++++++
modules/misc/medialibrary/medialibrary.cpp | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index 38cf37f895..ab8bcf14d8 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -465,6 +465,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_LIST_BANNED_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.
@@ -907,6 +908,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_list_banned_folder( vlc_medialibrary_t* p_ml,
+ vlc_ml_entry_point_list_t** pp_entrypoints )
+{
+ return vlc_ml_control( p_ml, VLC_ML_LIST_BANNED_FOLDERS, pp_entrypoints );
+}
+
static inline int vlc_ml_is_indexed( vlc_medialibrary_t* p_ml,
const char* psz_mrl, bool* p_res )
{
diff --git a/modules/misc/medialibrary/medialibrary.cpp b/modules/misc/medialibrary/medialibrary.cpp
index 1df3c59473..fb3d158706 100644
--- a/modules/misc/medialibrary/medialibrary.cpp
+++ b/modules/misc/medialibrary/medialibrary.cpp
@@ -548,8 +548,11 @@ int MediaLibrary::Control( int query, va_list args )
break;
}
case VLC_ML_LIST_FOLDERS:
+ case VLC_ML_LIST_BANNED_FOLDERS:
{
- auto entryPoints = m_ml->entryPoints()->all();
+ auto entryPoints = ( query == VLC_ML_LIST_FOLDERS )
+ ? m_ml->entryPoints()->all()
+ : m_ml->bannedEntryPoints()->all();
auto res = ml_convert_list<vlc_ml_entry_point_list_t,
vlc_ml_entry_point_t>( entryPoints );
*(va_arg( args, vlc_ml_entry_point_list_t**) ) = res;
More information about the vlc-commits
mailing list