aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelupus <elupus@svn>2010-12-26 13:22:52 +0000
committerelupus <elupus@svn>2010-12-26 13:22:52 +0000
commit98e624187fd47575b12fe80544cdd3eea18f233a (patch)
tree9843e78e8f4447ba2c46e58caa7b682e9c6deef6
parent87c4406dd6e0515a0520ce0ab6ae11e3202a26dc (diff)
fixed: must quote alsa pc when appending plug prefix since pcm name may contain paramters
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35695 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/cores/AudioRenderers/ALSADirectSound.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
index 8eedc3fe44..64be1b8fe1 100644
--- a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
+++ b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
@@ -32,6 +32,13 @@
using namespace std;
+static CStdString QuoteDevice(const CStdString& device)
+{
+ CStdString result(device);
+ result.Replace("'", "\\'");
+ return "'" + result + "'";
+}
+
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -153,7 +160,7 @@ bool CALSADirectSound::Initialize(IAudioCallback* pCallback, const CStdString& d
if((deviceuse + ":").Left(5) == "hdmi:"
|| (deviceuse + ":").Left(7) == "iec958:"
|| (deviceuse + ":").Left(6) == "spdif:")
- deviceuse = "plug:" + deviceuse;
+ deviceuse = "plug:" + QuoteDevice(deviceuse);
if(deviceuse == "default")
switch(iChannels)