summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2015-04-15 19:24:03 +0200
committerThomas Reufer <thomas@reufer.ch>2015-04-15 19:24:03 +0200
commitf92425c8b2ec7858b54d532c3680a07f4e0dc63e (patch)
tree235d591c58be2b031174a0c41becbc610be51b20
parentdf4e38ae264bea41448f35ae9f617da91c1a6019 (diff)
downloadvdr-plugin-rpihddevice-f92425c8b2ec7858b54d532c3680a07f4e0dc63e.tar.gz
vdr-plugin-rpihddevice-f92425c8b2ec7858b54d532c3680a07f4e0dc63e.tar.bz2
don't depend on multi channel PCM support for digital audio pass-through
-rw-r--r--HISTORY1
-rw-r--r--audio.c20
2 files changed, 6 insertions, 15 deletions
diff --git a/HISTORY b/HISTORY
index 36d6d6d..c4bfb16 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7,6 +7,7 @@ VDR Plugin 'rpihddevice' Revision History
- added font kerning
- support for GPU accelerated pixmaps
- fixed:
+ - don't depend on multi channel PCM support for digital audio pass-through
- improved video frame rate detection to be more tolerant to inaccurate values
- adapted cOvgRawOsd::Flush() to new cOsd::RenderPixmaps() of vdr-2.1.10
- fixed calculation of string height (reported by Klaus Schmidinger)
diff --git a/audio.c b/audio.c
index d9bf67a..fae5d5c 100644
--- a/audio.c
+++ b/audio.c
@@ -995,35 +995,25 @@ public:
if (codec != cAudioCodec::eInvalid && channels > 0)
{
m_inChannels = channels;
- cRpiAudioPort::ePort newPort = cRpiAudioPort::eLocal;
+ cRpiAudioPort::ePort newPort = cRpiSetup::GetAudioPort();
cAudioCodec::eCodec newCodec = cAudioCodec::ePCM;
DLOG("new audio codec: %dch %s", channels, cAudioCodec::Str(codec));
- if (cRpiSetup::GetAudioPort() == cRpiAudioPort::eHDMI &&
- cRpiSetup::IsAudioFormatSupported(cAudioCodec::ePCM, channels,
- samplingRate))
+ if (newPort == cRpiAudioPort::eHDMI)
{
- newPort = cRpiAudioPort::eHDMI;
-
// check if pass through is possible
if (cRpiSetup::IsAudioFormatSupported(codec, channels,
samplingRate))
newCodec = codec;
- // if we decode locally, upmix mono channels to 2.0
- else if (channels == 1)
+ // check for multi channel PCM, stereo downmix if not supported
+ else if (!cRpiSetup::IsAudioFormatSupported(cAudioCodec::ePCM,
+ channels, samplingRate))
channels = 2;
}
else
- {
channels = 2;
- // if 2ch PCM audio on HDMI is supported
- if (cRpiSetup::GetAudioPort() == cRpiAudioPort::eHDMI &&
- cRpiSetup::IsAudioFormatSupported(cAudioCodec::ePCM, 2,
- samplingRate))
- newPort = cRpiAudioPort::eHDMI;
- }
// if the user changes the port, this should change immediately
if (newPort != m_port)