diff --git a/src/contrib/taglib_plugin/TagReaderTaglib.cpp b/src/contrib/taglib_plugin/TagReaderTaglib.cpp index 6e998dd46..1b65ab17d 100644 --- a/src/contrib/taglib_plugin/TagReaderTaglib.cpp +++ b/src/contrib/taglib_plugin/TagReaderTaglib.cpp @@ -199,10 +199,12 @@ bool TagReaderTaglib::GetID3v2Tag(musik::core::Track *track){ // Split TRCK to track and totaltracks std::vector splitTrack; - boost::algorithm::split(splitTrack,aAllTags["TRCK"].front()->toString().toWString(),boost::algorithm::is_any_of(_T("/"))); - this->SetTagValue("track",splitTrack[0].c_str(),track); - if(splitTrack.size()>1){ - this->SetTagValue("totaltracks",splitTrack[1].c_str(),track); + if(!aAllTags["TRCK"].isEmpty()){ + boost::algorithm::split(splitTrack,aAllTags["TRCK"].front()->toString().toWString(),boost::algorithm::is_any_of(_T("/"))); + this->SetTagValue("track",splitTrack[0].c_str(),track); + if(splitTrack.size()>1){ + this->SetTagValue("totaltracks",splitTrack[1].c_str(),track); + } } this->SetTagValues("bpm",aAllTags["TBPM"],track); diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index bfa4c03e1..f216454d4 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -66,6 +66,7 @@ PluginFactory::~PluginFactory(void){ } void PluginFactory::LoadPlugins(){ + boost::mutex::scoped_lock lock(this->mutex); utfstring sPluginDir(GetPluginDirectory()); // Open plugin directory diff --git a/src/core/PluginFactory.h b/src/core/PluginFactory.h index 4350de315..196c32b20 100644 --- a/src/core/PluginFactory.h +++ b/src/core/PluginFactory.h @@ -41,6 +41,7 @@ #include #include #include +#include namespace musik{ namespace core{ @@ -70,6 +71,8 @@ namespace musik{ namespace core{ static PluginFactory sInstance; + boost::mutex mutex; + public: template @@ -86,6 +89,8 @@ namespace musik{ namespace core{ }; template std::vector> QueryInterface(const char* functionName){ + boost::mutex::scoped_lock lock(this->mutex); + typedef T* (__stdcall* PluginInterfaceCall)(); std::vector> plugins;