[vlc-commits] medialibrary: Store vlc_medialibrary_t as such instead of vlc_object_t
Hugo Beauzée-Luyssen
git at videolan.org
Thu Aug 16 17:53:39 CEST 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Aug 2 16:08:50 2018 +0200| [68d08f6b6f138298eda0eb99625c888853ae0855] | committer: Hugo Beauzée-Luyssen
medialibrary: Store vlc_medialibrary_t as such instead of vlc_object_t
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=68d08f6b6f138298eda0eb99625c888853ae0855
---
modules/misc/medialibrary/medialib.cpp | 30 +++++++++++++++---------------
modules/misc/medialibrary/medialibrary.h | 4 ++--
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/modules/misc/medialibrary/medialib.cpp b/modules/misc/medialibrary/medialib.cpp
index 6c2628a497..63e8af236e 100644
--- a/modules/misc/medialibrary/medialib.cpp
+++ b/modules/misc/medialibrary/medialib.cpp
@@ -171,8 +171,8 @@ void MediaLibrary::onMediaThumbnailReady( medialibrary::MediaPtr, bool )
{
}
-MediaLibrary::MediaLibrary( vlc_object_t* obj )
- : m_obj( obj )
+MediaLibrary::MediaLibrary( vlc_medialibrary_t* ml )
+ : m_vlc_ml( ml )
{
}
@@ -183,7 +183,7 @@ bool MediaLibrary::Start()
std::unique_ptr<medialibrary::IMediaLibrary> ml( NewMediaLibrary() );
- m_logger.reset( new Logger( m_obj ) );
+ m_logger.reset( new Logger( VLC_OBJECT( m_vlc_ml ) ) );
ml->setVerbosity( medialibrary::LogLevel::Info );
ml->setLogger( m_logger.get() );
@@ -194,23 +194,23 @@ bool MediaLibrary::Start()
switch ( initStatus )
{
case medialibrary::InitializeResult::AlreadyInitialized:
- msg_Info( m_obj, "MediaLibrary was already initialized" );
+ msg_Info( m_vlc_ml, "MediaLibrary was already initialized" );
return true;
case medialibrary::InitializeResult::Failed:
- msg_Err( m_obj, "Medialibrary failed to initialize" );
+ msg_Err( m_vlc_ml, "Medialibrary failed to initialize" );
return false;
case medialibrary::InitializeResult::DbReset:
- msg_Info( m_obj, "Database was reset" );
+ msg_Info( m_vlc_ml, "Database was reset" );
break;
case medialibrary::InitializeResult::Success:
- msg_Dbg( m_obj, "MediaLibrary successfully initialized" );
+ msg_Dbg( m_vlc_ml, "MediaLibrary successfully initialized" );
break;
}
- ml->addParserService( std::make_shared<MetadataExtractor>( m_obj ) );
+ ml->addParserService( std::make_shared<MetadataExtractor>( VLC_OBJECT( m_vlc_ml ) ) );
if ( ml->start() == false )
{
- msg_Err( m_obj, "Failed to start the MediaLibrary" );
+ msg_Err( m_vlc_ml, "Failed to start the MediaLibrary" );
return false;
}
@@ -219,7 +219,7 @@ bool MediaLibrary::Start()
// twice, as we start discovering the new folders, then reload them.
ml->reload();
- auto folders = vlc::wrap_cptr( var_InheritString( m_obj, "ml-folders" ) );
+ auto folders = vlc::wrap_cptr( var_InheritString( m_vlc_ml, "ml-folders" ) );
if ( folders != nullptr && strlen( folders.get() ) > 0 )
{
std::istringstream ss( folders.get() );
@@ -1177,20 +1177,20 @@ static int Control( vlc_medialibrary_t* module, int query, ... )
static int Open( vlc_object_t* obj )
{
- vlc_medialibrary_t* p_module = reinterpret_cast<vlc_medialibrary_t*>( obj );
+ vlc_medialibrary_t* p_ml = reinterpret_cast<vlc_medialibrary_t*>( obj );
try
{
- p_module->p_sys = new MediaLibrary( obj );
+ p_ml->p_sys = new MediaLibrary( p_ml );
}
catch ( const std::exception& ex )
{
msg_Err( obj, "Failed to instantiate/initialize medialibrary: %s", ex.what() );
return VLC_EGENERIC;
}
- p_module->pf_control = Control;
- p_module->pf_get = Get;
- p_module->pf_list = List;
+ p_ml->pf_control = Control;
+ p_ml->pf_get = Get;
+ p_ml->pf_list = List;
return VLC_SUCCESS;
}
diff --git a/modules/misc/medialibrary/medialibrary.h b/modules/misc/medialibrary/medialibrary.h
index 0dcb026ead..b900fa4338 100644
--- a/modules/misc/medialibrary/medialibrary.h
+++ b/modules/misc/medialibrary/medialibrary.h
@@ -103,7 +103,7 @@ private:
class MediaLibrary : public medialibrary::IMediaLibraryCb
{
public:
- MediaLibrary( vlc_object_t* obj );
+ MediaLibrary( vlc_medialibrary_t* ml );
bool Start();
int Control( int query, va_list args );
int List( int query, const vlc_ml_query_params_t* params, va_list args );
@@ -127,7 +127,7 @@ private:
static medialibrary::SortingCriteria sortingCriteria( int sort );
private:
- vlc_object_t* m_obj;
+ vlc_medialibrary_t* m_vlc_ml;
std::unique_ptr<Logger> m_logger;
std::unique_ptr<medialibrary::IMediaLibrary> m_ml;
More information about the vlc-commits
mailing list