aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobo1on1 <bob-nospam-@xbmc.org>2011-09-25 22:39:14 +0200
committerbobo1on1 <bob-nospam-@xbmc.org>2011-09-25 22:39:14 +0200
commit1704acf27ced3b8c523d7c8e2daf317d0f8426e5 (patch)
tree891a6f37bda3f68ad68f2c768ce2361cd334d061
parent8ea5c656467710c70c21a62222c31e6631c9e5a6 (diff)
fixed: do volume deamplify after running the remapper, so that the volume control doesn't affect the dynamic range
-rw-r--r--xbmc/cores/AudioRenderers/ALSADirectSound.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
index 2378d4f1fb..845dce3a1d 100644
--- a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
+++ b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
@@ -508,10 +508,6 @@ unsigned int CALSADirectSound::AddPackets(const void* data, unsigned int len)
return 0;
}
- // handle volume de-amp
- if (!m_bPassthrough)
- m_amp.DeAmplify((short *)data, framesToWrite * m_uiDataChannels);
-
int writeResult;
if (m_bPassthrough && m_nCurrentVolume == VOLUME_MINIMUM)
{
@@ -526,10 +522,16 @@ unsigned int CALSADirectSound::AddPackets(const void* data, unsigned int len)
/* remap the data to the correct channels */
uint8_t outData[bytesToWrite];
m_remap.Remap((void *)data, outData, framesToWrite, m_drc);
+ m_amp.DeAmplify((short *)outData, bytesToWrite / 2);
writeResult = snd_pcm_writei(m_pPlayHandle, outData, framesToWrite);
}
else
+ {
+ if (!m_bPassthrough)
+ m_amp.DeAmplify((short *)data, framesToWrite * m_uiDataChannels);
+
writeResult = snd_pcm_writei(m_pPlayHandle, data, framesToWrite);
+ }
}
if ( writeResult == -EPIPE )
{