Commit 50bcf79d authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

VLCThumbnailer: Don't assume a valid VLC media already exist

If we restart the scan with a successful metadata parsing of a file, but
no thumbnail, we won't have an initialized VLC media to compute the
thumbnail from
parent 1395f7e3
......@@ -83,6 +83,13 @@ parser::Task::Status VLCThumbnailer::run( parser::Task& task )
LOG_INFO( "Generating ", file->mrl(), " thumbnail..." );
if ( task.vlcMedia.isValid() == false )
{
auto fromType = file->mrl().find( "://" ) != std::string::npos ? VLC::Media::FromType::FromLocation :
VLC::Media::FromType::FromPath;
task.vlcMedia = VLC::Media( m_instance, file->mrl(), fromType );
}
task.vlcMedia.addOption( ":no-audio" );
task.vlcMedia.addOption( ":no-osd" );
task.vlcMedia.addOption( ":no-spu" );
......
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