Merge pull request #4148 from popcornmix/streamchannels
authorjmarshallnz <jcmarsha@gmail.com>
Tue, 4 Feb 2014 20:17:59 +0000 (12:17 -0800)
committerjmarshallnz <jcmarsha@gmail.com>
Tue, 4 Feb 2014 20:17:59 +0000 (12:17 -0800)
[PiSink] Set hdmi stream channels when in passthrough mode

xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
xbmc/cores/AudioEngine/Sinks/AESinkPi.h

index d8e28ae..54c8ac8 100644 (file)
@@ -66,6 +66,19 @@ void CAESinkPi::SetAudioDest()
 
 bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device)
 {
+  char response[80];
+  /* if we are raw need to let gpu know */
+  if (AE_IS_RAW(format.m_dataFormat))
+  {
+    vc_gencmd(response, sizeof response, "hdmi_stream_channels 1");
+    m_passthrough = true;
+  }
+  else
+  {
+    vc_gencmd(response, sizeof response, "hdmi_stream_channels 0");
+    m_passthrough = false;
+  }
+
   m_initDevice = device;
   m_initFormat = format;
   // setup for a 50ms sink feed from SoftAE
index e56f3aa..4cca143 100644 (file)
@@ -60,6 +60,7 @@ private:
   uint32_t             m_submitted;
   OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_input;
   COMXCoreComponent    m_omx_render;
+  bool                 m_passthrough;
 };
 
 #endif