AE: Fix incorrect output frame rate of E-AC-3 passthrough
authorAnssi Hannula <anssi@xbmc.org>
Sat, 31 Aug 2013 12:32:12 +0000 (15:32 +0300)
committerAnssi Hannula <anssi@xbmc.org>
Sun, 1 Sep 2013 09:11:43 +0000 (12:11 +0300)
E-AC-3 passthrough requires an IEC 60958 frame rate of 4 times the
encoded sample rate as per the IEC 61937-3:2007 specification.

Currently AEStreamInfo uses a hardcoded value of 192kHz, causing streams
with a sample rate of less than 48kHz to be played back at an abnormally
fast rate.

Fix AEStreamInfo to use the correct value.

xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp

index 20c8c57..b5d9776 100644 (file)
@@ -414,9 +414,8 @@ unsigned int CAEStreamInfo::SyncAC3(uint8_t *data, unsigned int size)
 
       m_repeat       = MAX_EAC3_BLOCKS / blocks;
 
-      // sampling rate multiplied with number of channels must equal the value
-      // given by the pack function
-      m_outputRate = 192000;
+      // E-AC-3 rate is 4 times bitstream sample rate as per IEC 61937.
+      m_outputRate = 4 * m_sampleRate;
 
       if (m_dataType == STREAM_TYPE_EAC3 && m_hasSync && skip == 0)
         return 0;