[vlc-commits] vlc_media_library: Rename vlc_ml_get -> vlc_ml_instance_get

Hugo Beauzée-Luyssen git at videolan.org
Thu Aug 16 17:53:43 CEST 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Aug 13 11:34:14 2018 +0200| [bf185881836c9e0159c155de0b6ea8d4ff4117eb] | committer: Hugo Beauzée-Luyssen

vlc_media_library: Rename vlc_ml_get -> vlc_ml_instance_get

And drop _obj suffix for release function, so that medialibrary
entities are now fetched/released using vlc_ml_get & vlc_ml_release

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

 include/vlc_media_library.h              | 34 ++++++++++++++++----------------
 modules/misc/medialibrary/medialibrary.h |  4 ++--
 src/libvlccore.sym                       |  2 +-
 src/misc/medialibrary.c                  |  4 ++--
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index d0550cbe78..ff330e9274 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -489,8 +489,8 @@ struct vlc_medialibrary_t
 vlc_medialibrary_t* libvlc_MlCreate( libvlc_int_t* p_libvlc );
 void libvlc_MlRelease( vlc_medialibrary_t* p_ml );
 
-VLC_API vlc_medialibrary_t* vlc_ml_get( vlc_object_t* p_obj ) VLC_USED;
-#define vlc_ml_get(x) vlc_ml_get( VLC_OBJECT(x) )
+VLC_API vlc_medialibrary_t* vlc_ml_instance_get( vlc_object_t* p_obj ) VLC_USED;
+#define vlc_ml_instance_get(x) vlc_ml_instance_get( VLC_OBJECT(x) )
 
 VLC_API void vlc_ml_entrypoints_release( vlc_ml_entrypoint_t* p_list, size_t i_nb_items );
 
@@ -1005,7 +1005,7 @@ static inline size_t vlc_ml_count_playlists( vlc_medialibrary_t* p_ml, const vlc
 #endif /* C++ */
 
 #ifndef __cplusplus
-# define vlc_ml_release_obj( OBJ ) _Generic( ( OBJ ), \
+# define vlc_ml_release( OBJ ) _Generic( ( OBJ ), \
     vlc_ml_show_t*: vlc_ml_show_release, \
     vlc_ml_artist_t*: vlc_ml_artist_release, \
     vlc_ml_album_t*: vlc_ml_album_release, \
@@ -1022,20 +1022,20 @@ static inline size_t vlc_ml_count_playlists( vlc_medialibrary_t* p_ml, const vlc
     vlc_ml_playlist_list_t*: vlc_ml_playlist_list_release \
     )( OBJ )
 #else
-static inline void vlc_ml_release_obj( vlc_ml_show_t* show ) { vlc_ml_show_release( show ); }
-static inline void vlc_ml_release_obj( vlc_ml_artist_t* artist ) { vlc_ml_artist_release( artist ); }
-static inline void vlc_ml_release_obj( vlc_ml_album_t* album ) { vlc_ml_album_release( album ); }
-static inline void vlc_ml_release_obj( vlc_ml_genre_t* genre ) { vlc_ml_genre_release( genre ); }
-static inline void vlc_ml_release_obj( vlc_ml_media_t* media ) { vlc_ml_media_release( media ); }
-static inline void vlc_ml_release_obj( vlc_ml_playlist_t* playlist ) { vlc_ml_playlist_release( playlist ); }
-static inline void vlc_ml_release_obj( vlc_ml_label_list_t* list ) { vlc_ml_label_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_file_list_t* list ) { vlc_ml_file_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_artist_list_t* list ) { vlc_ml_artist_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_media_list_t* list ) { vlc_ml_media_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_album_list_t* list ) { vlc_ml_album_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_show_list_t* list ) { vlc_ml_show_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_genre_list_t* list ) { vlc_ml_genre_list_release( list ); }
-static inline void vlc_ml_release_obj( vlc_ml_playlist_list_t* list ) { vlc_ml_playlist_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_show_t* show ) { vlc_ml_show_release( show ); }
+static inline void vlc_ml_release( vlc_ml_artist_t* artist ) { vlc_ml_artist_release( artist ); }
+static inline void vlc_ml_release( vlc_ml_album_t* album ) { vlc_ml_album_release( album ); }
+static inline void vlc_ml_release( vlc_ml_genre_t* genre ) { vlc_ml_genre_release( genre ); }
+static inline void vlc_ml_release( vlc_ml_media_t* media ) { vlc_ml_media_release( media ); }
+static inline void vlc_ml_release( vlc_ml_playlist_t* playlist ) { vlc_ml_playlist_release( playlist ); }
+static inline void vlc_ml_release( vlc_ml_label_list_t* list ) { vlc_ml_label_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_file_list_t* list ) { vlc_ml_file_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_artist_list_t* list ) { vlc_ml_artist_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_media_list_t* list ) { vlc_ml_media_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_album_list_t* list ) { vlc_ml_album_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_show_list_t* list ) { vlc_ml_show_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_genre_list_t* list ) { vlc_ml_genre_list_release( list ); }
+static inline void vlc_ml_release( vlc_ml_playlist_list_t* list ) { vlc_ml_playlist_list_release( list ); }
 #endif
 
 #endif /* VLC_MEDIA_LIBRARY_H */
diff --git a/modules/misc/medialibrary/medialibrary.h b/modules/misc/medialibrary/medialibrary.h
index b900fa4338..675c8449ad 100644
--- a/modules/misc/medialibrary/medialibrary.h
+++ b/modules/misc/medialibrary/medialibrary.h
@@ -188,7 +188,7 @@ To* ml_convert_list( const std::vector<std::shared_ptr<From>>& input )
     // Allocate the ml_*_list_t
     auto list = vlc::wrap_cptr(
         static_cast<To*>( malloc( sizeof( To ) + input.size() * sizeof( ItemType ) ) ),
-        static_cast<void(*)(To*)>( &vlc_ml_release_obj ) );
+        static_cast<void(*)(To*)>( &vlc_ml_release ) );
     if ( unlikely( list == nullptr ) )
         return nullptr;
 
@@ -210,7 +210,7 @@ T* CreateAndConvert( const Input* input )
         return nullptr;
     auto res = vlc::wrap_cptr(
                 static_cast<T*>( malloc( sizeof( T ) ) ),
-                static_cast<void(*)(T*)>( &vlc_ml_release_obj ) );
+                static_cast<void(*)(T*)>( &vlc_ml_release ) );
     if ( unlikely( res == nullptr ) )
         return nullptr;
     if ( Convert( input, *res ) == false )
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 118664d413..f8f2188fc7 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -592,7 +592,7 @@ vlc_keystore_find
 vlc_keystore_remove
 vlc_keystore_store
 vlc_keystore_release_entries
-vlc_ml_get
+vlc_ml_instance_get
 vlc_ml_entrypoints_release
 vlc_ml_show_release
 vlc_ml_artist_release
diff --git a/src/misc/medialibrary.c b/src/misc/medialibrary.c
index c844b3b4d8..9b468bdc1a 100644
--- a/src/misc/medialibrary.c
+++ b/src/misc/medialibrary.c
@@ -60,8 +60,8 @@ void libvlc_MlRelease( vlc_medialibrary_t* p_ml )
     vlc_object_release( p_ml );
 }
 
-#undef vlc_ml_get
-vlc_medialibrary_t* vlc_ml_get( vlc_object_t* p_obj )
+#undef vlc_ml_instance_get
+vlc_medialibrary_t* vlc_ml_instance_get( vlc_object_t* p_obj )
 {
     libvlc_priv_t* p_priv = libvlc_priv( p_obj->obj.libvlc );
     return p_priv->p_media_library;



More information about the vlc-commits mailing list