aboutsummaryrefslogtreecommitdiff
path: root/guilib/AudioContext.cpp
diff options
context:
space:
mode:
authorwiso <wiso@svn>2010-01-10 21:32:26 +0000
committerwiso <wiso@svn>2010-01-10 21:32:26 +0000
commit8f974deb994fa226f39e4baae58bacbb03edbe4f (patch)
tree87add9a260cb52458896f4439ac40cdfb6c6705f /guilib/AudioContext.cpp
parentdf7e6b09f1b28357436dc10d30f3691e712c8c57 (diff)
[WIN32] Fix for AudioContext device naming #8457 (thanks to ArtVandelae)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26651 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/AudioContext.cpp')
-rw-r--r--guilib/AudioContext.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/guilib/AudioContext.cpp b/guilib/AudioContext.cpp
index 5fd5cf79f7..7874717dd6 100644
--- a/guilib/AudioContext.cpp
+++ b/guilib/AudioContext.cpp
@@ -71,11 +71,18 @@ CAudioContext::~CAudioContext()
// \brief Create a new device by type (DEFAULT_DEVICE, DIRECTSOUND_DEVICE, AC97_DEVICE)
void CAudioContext::SetActiveDevice(int iDevice)
{
+ CStdString strAudioDev = g_guiSettings.GetString("audiooutput.audiodevice");
+
/* if device is the same, no need to bother */
#ifdef _WIN32
+
+ int iPos = strAudioDev.Find(':');
+ if(iPos != CStdString::npos)
+ strAudioDev.erase(0, iPos+1);
+
if (iDevice == DEFAULT_DEVICE)
iDevice = DIRECTSOUND_DEVICE; // default device on win32 is directsound device
- if(m_iDevice == iDevice && g_guiSettings.GetString("audiooutput.audiodevice").Equals(m_strDevice))
+ if(m_iDevice == iDevice && strAudioDev.Equals(m_strDevice))
{
if (iDevice != NONE && m_pDirectSoundDevice)
{
@@ -98,7 +105,7 @@ void CAudioContext::SetActiveDevice(int iDevice)
RemoveActiveDevice();
m_iDevice=iDevice;
- m_strDevice=g_guiSettings.GetString("audiooutput.audiodevice");
+ m_strDevice=strAudioDev;
#ifdef HAS_AUDIO
memset(&g_digitaldevice, 0, sizeof(GUID));
@@ -117,7 +124,7 @@ void CAudioContext::SetActiveDevice(int iDevice)
{
DSDeviceInfo dev = *iter;
- if (g_guiSettings.GetString("audiooutput.audiodevice").Equals(dev.strDescription))
+ if (strAudioDev.Equals(dev.strDescription))
{
guid = dev.lpGuid;
CLog::Log(LOGDEBUG, "%s - selecting %s as output devices", __FUNCTION__, dev.strDescription.c_str());