aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorCrystalPT <CrystalPT@svn>2010-08-21 01:28:00 +0000
committerCrystalPT <CrystalPT@svn>2010-08-21 01:28:00 +0000
commit6305227f6db276e26169f5dbd6e34a51dd57eaf3 (patch)
treea4e21870549f8420e03d8bf7793107e23c91dcb3 /guilib
parentb64647a7594a5607ab903aee6cf0788a6567cf04 (diff)
[WIN32] improve DirectSound device creation logging
(cherry picked from commit fbfb9794a4763ca2a8b6bcece0cfe4c1ff71a09c) git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@33000 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r--guilib/AudioContext.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/guilib/AudioContext.cpp b/guilib/AudioContext.cpp
index 1fd0e60de0..7334439dbd 100644
--- a/guilib/AudioContext.cpp
+++ b/guilib/AudioContext.cpp
@@ -76,6 +76,7 @@ void CAudioContext::SetActiveDevice(int iDevice)
/* if device is the same, no need to bother */
#ifdef _WIN32
+ HRESULT hr;
int iPos = strAudioDev.Find(':');
if(iPos != CStdString::npos)
strAudioDev.erase(0, iPos+1);
@@ -109,8 +110,9 @@ void CAudioContext::SetActiveDevice(int iDevice)
#ifdef HAS_AUDIO
memset(&g_digitaldevice, 0, sizeof(GUID));
- if (FAILED(DirectSoundEnumerate(DSEnumCallback, this)))
- CLog::Log(LOGERROR, "%s - failed to enumerate output devices", __FUNCTION__);
+ hr = DirectSoundEnumerate(DSEnumCallback, this);
+ if (FAILED(hr))
+ CLog::Log(LOGERROR, "%s - failed to enumerate output devices (0x%08X)", __FUNCTION__, hr);
if (iDevice==DIRECTSOUND_DEVICE
|| iDevice==DIRECTSOUND_DEVICE_DIGITAL)
@@ -119,6 +121,9 @@ void CAudioContext::SetActiveDevice(int iDevice)
#ifdef _WIN32
CWDSound p_dsound;
std::vector<DSDeviceInfo > deviceList = p_dsound.GetSoundDevices();
+ if (deviceList.size() == 0)
+ CLog::Log(LOGDEBUG, "%s - no output devices found.", __FUNCTION__);
+
std::vector<DSDeviceInfo >::const_iterator iter = deviceList.begin();
for (int i=0; iter != deviceList.end(); i++)
{
@@ -133,6 +138,8 @@ void CAudioContext::SetActiveDevice(int iDevice)
++iter;
}
+ if (guid == NULL)
+ CLog::Log(LOGDEBUG, "%s - (default playback device).", __FUNCTION__);
#else
if(iDevice == DIRECTSOUND_DEVICE_DIGITAL
&& ( g_digitaldevice.Data1 || g_digitaldevice.Data2
@@ -141,14 +148,16 @@ void CAudioContext::SetActiveDevice(int iDevice)
#endif
// Create DirectSound
- if (FAILED(DirectSoundCreate( guid, &m_pDirectSoundDevice, NULL )))
+ hr = DirectSoundCreate( guid, &m_pDirectSoundDevice, NULL );
+ if (FAILED(hr))
{
- CLog::Log(LOGERROR, "DirectSoundCreate() Failed");
+ CLog::Log(LOGERROR, "DirectSoundCreate() Failed (0x%08X)", hr);
return;
}
- if (FAILED(m_pDirectSoundDevice->SetCooperativeLevel(g_hWnd, DSSCL_PRIORITY)))
+ hr = m_pDirectSoundDevice->SetCooperativeLevel(g_hWnd, DSSCL_PRIORITY);
+ if (FAILED(hr))
{
- CLog::Log(LOGERROR, "DirectSoundDevice::SetCooperativeLevel() Failed");
+ CLog::Log(LOGERROR, "DirectSoundDevice::SetCooperativeLevel() Failed (0x%08X)", hr);
return;
}
}