Skip to content
This repository
Browse code

ActiveAE: fix crash for multiple streams when transcoding

  • Loading branch information...
commit 61acd19623079eb1b9326e371bec36d5db0cecd5 1 parent 3806410
Rainer Hochecker authored August 26, 2013
8  xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
@@ -801,7 +801,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt)
801 801
 
802 802
   AEAudioFormat sinkInputFormat, inputFormat;
803 803
   AEAudioFormat oldInternalFormat = m_internalFormat;
804  
-  m_mode = MODE_PCM;
  804
+  bool updateMode = true;
805 805
 
806 806
   if (m_streams.empty())
807 807
   {
@@ -822,6 +822,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt)
822 822
   else if (m_streams.size() > 1 && m_silenceBuffers == NULL)
823 823
   {
824 824
     inputFormat = m_sinkRequestFormat;
  825
+    updateMode = false;
825 826
   }
826 827
   else
827 828
   {
@@ -829,7 +830,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt)
829 830
   }
830 831
 
831 832
   m_sinkRequestFormat = inputFormat;
832  
-  ApplySettingsToFormat(m_sinkRequestFormat, m_settings, true);
  833
+  ApplySettingsToFormat(m_sinkRequestFormat, m_settings, updateMode);
833 834
   std::string device = AE_IS_RAW(m_sinkRequestFormat.m_dataFormat) ? m_settings.passthoughdevice : m_settings.device;
834 835
   std::string driver;
835 836
   CAESinkFactory::ParseDevice(device, driver);
@@ -1210,6 +1211,9 @@ void CActiveAE::ChangeResampleQuality()
1210 1211
 
1211 1212
 void CActiveAE::ApplySettingsToFormat(AEAudioFormat &format, AudioSettings &settings, bool setmode)
1212 1213
 {
  1214
+  if (setmode)
  1215
+    m_mode = MODE_PCM;
  1216
+
1213 1217
   // raw pass through
1214 1218
   if (m_settings.mode != AUDIO_ANALOG && AE_IS_RAW(format.m_dataFormat))
1215 1219
   {

0 notes on commit 61acd19

Please sign in to comment.
Something went wrong with that request. Please try again.