Commit b0e63770 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

parser: Don't ignore initialization failures

parent e01dcce9
......@@ -54,7 +54,8 @@ Parser::~Parser()
void Parser::addService( ServicePtr service )
{
auto worker = std::make_unique<ParserWorker>();
worker->initialize( m_ml, this, std::move( service ) );
if ( worker->initialize( m_ml, this, std::move( service ) ) == false )
return;
m_services.push_back( std::move( worker ) );
}
......
......@@ -98,12 +98,12 @@ void ParserWorker::parse( std::shared_ptr<parser::Task> t )
}
}
void ParserWorker::initialize( MediaLibrary* ml, IParserCb* parserCb, std::unique_ptr<IParserService> service )
bool ParserWorker::initialize( MediaLibrary* ml, IParserCb* parserCb, std::unique_ptr<IParserService> service )
{
m_service = std::move( service );
m_parserCb = parserCb;
// Run the service specific initializer
m_service->initialize( ml );
return m_service->initialize( ml );
}
bool ParserWorker::isIdle() const
......
......@@ -60,7 +60,7 @@ public:
///
void stop();
void parse( std::shared_ptr<parser::Task> t );
void initialize( MediaLibrary* ml, IParserCb* parserCb, std::unique_ptr<IParserService> service );
bool initialize( MediaLibrary* ml, IParserCb* parserCb, std::unique_ptr<IParserService> service );
bool isIdle() const;
///
/// \brief flush flush every currently scheduled tasks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment