Diff of /branches/AudioEngine/xbmc/cores/AudioEngine/AEPackIEC958.cpp [r35725] .. [r35726] Maximize Restore

  Switch to side-by-side view

--- a/branches/AudioEngine/xbmc/cores/AudioEngine/AEPackIEC958.cpp
+++ b/branches/AudioEngine/xbmc/cores/AudioEngine/AEPackIEC958.cpp
@@ -39,11 +39,12 @@
 
   packet->m_preamble1 = IEC958_PREAMBLE1;
   packet->m_preamble2 = IEC958_PREAMBLE2;
-  packet->m_type      = IEC958_TYPE_AC3;
+  if (data == NULL)
+    data = packet->m_data;
+  int bitstream_mode = data[5] & 0x7;
+  packet->m_type      = IEC958_TYPE_AC3 | (bitstream_mode << 8);
   packet->m_length    = size << 3;
 
-  if (data == NULL)
-    data = packet->m_data;
 #ifdef __BIG_ENDIAN__
   else
     memcpy(packet->m_data, data, size);