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

View File

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