From f4084423954a80826449b5074ecc6ddf08aef634 Mon Sep 17 00:00:00 2001 From: anssih Date: Sun, 12 Dec 2010 20:25:58 +0000 Subject: [PATCH] changed: remap mono audio to stereo even if we have a center speaker This also fixes mono audio when using digital out when a center speaker is enabled. git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35622 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 --- xbmc/utils/PCMRemap.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xbmc/utils/PCMRemap.cpp b/xbmc/utils/PCMRemap.cpp index b803d1d7ef99f..e0de92fa9172a 100644 --- a/xbmc/utils/PCMRemap.cpp +++ b/xbmc/utils/PCMRemap.cpp @@ -164,6 +164,7 @@ static struct PCMMapInfo PCMDownmixTable[PCM_MAX_CH][PCM_MAX_MIX] = CPCMRemap::CPCMRemap() : m_inSet (false), m_outSet (false), + m_ignoreLayout(false), m_inChannels (0), m_outChannels (0), m_inSampleSize(0) @@ -267,6 +268,16 @@ void CPCMRemap::ResolveChannels() } } + /* force mono audio to front left and front right */ + if (!m_ignoreLayout && m_inChannels == 1 && m_inMap[0] == PCM_FRONT_CENTER + && m_useable[PCM_FRONT_LEFT] && m_useable[PCM_FRONT_RIGHT]) + { + CLog::Log(LOGDEBUG, "CPCMRemap: Mapping mono audio to front left and front right"); + m_useable[PCM_FRONT_CENTER] = false; + m_useable[PCM_FRONT_LEFT_OF_CENTER] = false; + m_useable[PCM_FRONT_RIGHT_OF_CENTER] = false; + } + /* see if our input has side/back channels */ for(in_ch = 0; in_ch < m_inChannels; ++in_ch) switch(m_inMap[in_ch])