Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3229 from wsoltys/xpcleanup

[WIN32] cosmetics: removed some XP only code.
  • Loading branch information...
commit 24665612e08b4226c7aeb3296ad508019df11203 2 parents bbcdc74 + f097959
@MartijnKaijser MartijnKaijser authored
View
4 xbmc/cores/AudioEngine/AESinkFactory.cpp
@@ -101,7 +101,7 @@ IAESink *CAESinkFactory::Create(std::string &device, AEAudioFormat &desiredForma
#if defined(TARGET_WINDOWS)
- if ((driver.empty() && g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) ||
+ if ((driver.empty() ||
driver == "WASAPI") && !g_advancedSettings.m_audioForceDirectSound)
TRY_SINK(WASAPI)
else
@@ -141,7 +141,7 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force)
{
#if defined(TARGET_WINDOWS)
ENUMERATE_SINK(DirectSound, force);
- if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) && !g_advancedSettings.m_audioForceDirectSound)
+ if (!g_advancedSettings.m_audioForceDirectSound)
ENUMERATE_SINK(WASAPI, force);
#elif defined(TARGET_ANDROID)
ENUMERATE_SINK(AUDIOTRACK, force);
View
52 xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -243,9 +243,6 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 /** Better position accuracy */
| DSBCAPS_GLOBALFOCUS; /** Allows background playing */
- if (!g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
- dsbdesc.dwFlags |= DSBCAPS_LOCHARDWARE; /** Needed for 5.1 on emu101k, fails by design on Vista */
-
dsbdesc.dwBufferBytes = m_dwBufferLen;
dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&wfxex;
@@ -512,55 +509,6 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bo
std::string strDD = GetDefaultDevice();
- /* See if we are on Windows XP */
- if (!g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
- {
- /* We are on XP - WASAPI not supported - enumerate using DS devices */
- LPGUID deviceGUID = NULL;
- RPC_CSTR cszGUID;
- std::string szGUID;
- std::list<DSDevice> DSDeviceList;
- DirectSoundEnumerate(DSEnumCallback, &DSDeviceList);
-
- for(std::list<DSDevice>::iterator itt = DSDeviceList.begin(); itt != DSDeviceList.end(); ++itt)
- {
- if (UuidToString((*itt).lpGuid, &cszGUID) != RPC_S_OK)
- continue; /* could not convert GUID to string - skip device */
-
- deviceInfo.m_channels.Reset();
- deviceInfo.m_dataFormats.clear();
- deviceInfo.m_sampleRates.clear();
-
- szGUID = (LPSTR)cszGUID;
-
- deviceInfo.m_deviceName = "{" + szGUID + "}";
- deviceInfo.m_displayName = (*itt).name;
- deviceInfo.m_displayNameExtra = std::string("DirectSound: ") + (*itt).name;
-
- deviceInfo.m_deviceType = AE_DEVTYPE_PCM;
- deviceInfo.m_channels = layoutsByChCount[2];
-
- deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_FLOAT));
- deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_AC3));
-
- deviceInfo.m_sampleRates.push_back((DWORD) 96000);
-
- deviceInfoList.push_back(deviceInfo);
-
- // add the default device with m_deviceName = default
- if(strDD == deviceInfo.m_deviceName)
- {
- deviceInfo.m_deviceName = std::string("default");
- deviceInfo.m_displayName = std::string("default");
- deviceInfo.m_displayNameExtra = std::string("");
- deviceInfoList.push_back(deviceInfo);
- }
- }
-
- RpcStringFree(&cszGUID);
- return;
- }
-
/* Windows Vista or later - supporting WASAPI device probing */
hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator);
EXIT_ON_FAILURE(hr, __FUNCTION__": Could not allocate WASAPI device enumerator. CoCreateInstance error code: %li", hr)
View
3  xbmc/cores/VideoRenderers/BaseRenderer.cpp
@@ -731,8 +731,7 @@ void CBaseRenderer::SettingOptionsRenderMethodsFiller(const CSetting *setting, s
list.push_back(make_pair(g_localizeStrings.Get(13416), RENDER_METHOD_AUTO));
#ifdef HAS_DX
- if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
- list.push_back(make_pair(g_localizeStrings.Get(16319), RENDER_METHOD_DXVA));
+ list.push_back(make_pair(g_localizeStrings.Get(16319), RENDER_METHOD_DXVA));
list.push_back(make_pair(g_localizeStrings.Get(13431), RENDER_METHOD_D3D_PS));
list.push_back(make_pair(g_localizeStrings.Get(13419), RENDER_METHOD_SOFTWARE));
#endif
View
2  xbmc/rendering/dx/RenderSystemDX.cpp
@@ -100,7 +100,7 @@ bool CRenderSystemDX::InitRenderSystem()
{
m_bVSync = true;
- m_useD3D9Ex = (g_advancedSettings.m_AllowD3D9Ex && g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista) && LoadD3D9Ex());
+ m_useD3D9Ex = (g_advancedSettings.m_AllowD3D9Ex && LoadD3D9Ex());
m_pD3D = NULL;
if (m_useD3D9Ex)
View
3  xbmc/settings/Settings.cpp
@@ -766,8 +766,7 @@ void CSettings::InitializeConditions()
#endif
#if defined(TARGET_WINDOWS) && defined(HAS_DX)
m_settingsManager->AddCondition("has_dx");
- if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
- m_settingsManager->AddCondition("hasdxva2");
+ m_settingsManager->AddCondition("hasdxva2");
#endif
if (g_application.IsStandAlone())
View
3  xbmc/utils/Environment.cpp
@@ -77,8 +77,7 @@ std::string CEnvironment::win32ConvertWToUtf8(const std::wstring &text, bool *re
if (resultSuccessful != NULL)
*resultSuccessful = false;
- static const DWORD convFlags = (CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista)) ?
- /*WC_ERR_INVALID_CHARS*/ 0x80 : 0;
+ static const DWORD convFlags = /*WC_ERR_INVALID_CHARS*/ 0x80;
int bufSize = WideCharToMultiByte(CP_UTF8, convFlags, text.c_str(), -1, NULL, 0, NULL, NULL);
if (bufSize == 0)
return "";
View
15 xbmc/utils/SystemInfo.cpp
@@ -367,17 +367,10 @@ CStdString CSysInfo::GetCPUSerial()
bool CSysInfo::IsAeroDisabled()
{
#ifdef TARGET_WINDOWS
- if (IsWindowsVersionAtLeast(CSysInfo::WindowsVersionVista))
- {
- BOOL aeroEnabled = FALSE;
- HRESULT res = DwmIsCompositionEnabled(&aeroEnabled);
- if (SUCCEEDED(res))
- return !aeroEnabled;
- }
- else
- {
- return true;
- }
+ BOOL aeroEnabled = FALSE;
+ HRESULT res = DwmIsCompositionEnabled(&aeroEnabled);
+ if (SUCCEEDED(res))
+ return !aeroEnabled;
#endif
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.