NowPlaying.dll:

- Fixed that invalid PlayerName= caused crash
- Fixed that PlayerType=COVER didn't work with iTunes
This commit is contained in:
Birunthan Mohanathas 2012-03-02 12:27:37 +00:00
parent 4a7ef7508f
commit e5f5ea41cb
2 changed files with 16 additions and 15 deletions

View File

@ -171,23 +171,24 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
{
parent->player = CPlayerWinamp::Create(WA_WINAMP);
}
else if (_wcsicmp(L"WLM", str) == 0)
{
parent->player = CPlayerWLM::Create();
}
else if (_wcsicmp(L"WMP", str) == 0)
{
parent->player = CPlayerWMP::Create();
}
else
{
std::wstring error = L"NowPlaying.dll: Invalid PlayerName=";
error += str;
error += L" in [";
error += parent->ownerName;
error += L"]";
RmLog(LOG_ERROR, error.c_str());
return;
// Default to WLM
parent->player = CPlayerWLM::Create();
if (_wcsicmp(L"WLM", str) != 0)
{
std::wstring error = L"NowPlaying.dll: Invalid PlayerName=";
error += str;
error += L" in [";
error += parent->ownerName;
error += L"]";
RmLog(LOG_ERROR, error.c_str());
}
}
parent->player->AddInstance();
@ -346,7 +347,7 @@ PLUGIN_EXPORT LPCWSTR GetString(void* data)
{
Measure* measure = (Measure*)data;
ParentMeasure* parent = measure->parent;
if (!parent) return L"Invalid player";
if (!parent) return NULL;
const CPlayer* player = parent->player;
static WCHAR buffer[32];

View File

@ -423,8 +423,8 @@ void CPlayerITunes::OnTrackChange()
if (SUCCEEDED(hr))
{
tmpStr = (BSTR)m_TempCoverPath.c_str();
hr = artwork->SaveArtworkToFile(tmpStr);
CComBSTR coverPath = m_TempCoverPath.c_str();
hr = artwork->SaveArtworkToFile(coverPath);
if (SUCCEEDED(hr))
{
m_CoverPath = m_TempCoverPath;