Guest User

Untitled

a guest
May 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. diff --git a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
  2. index 1e766c3..708c20a 100644
  3. --- a/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
  4. +++ b/xbmc/cores/AudioRenderers/ALSADirectSound.cpp
  5. @@ -60,8 +60,17 @@ bool CALSADirectSound::Initialize(IAudioCallback* pCallback, const CStdString& d
  6. PCM_FRONT_CENTER, PCM_LOW_FREQUENCY,
  7. PCM_SIDE_LEFT , PCM_SIDE_RIGHT
  8. };
  9. + static enum PCMChannels HDMIChannelMap[] = { PCM_FRONT_LEFT, PCM_FRONT_RIGHT
  10. + , PCM_FRONT_CENTER, PCM_LOW_FREQUENCY
  11. + , PCM_BACK_LEFT, PCM_BACK_RIGHT
  12. + , PCM_FRONT_LEFT_OF_CENTER, PCM_FRONT_RIGHT_OF_CENTER
  13. + , PCM_BACK_CENTER, PCM_SIDE_LEFT, PCM_SIDE_RIGHT};
  14. + CStdString deviceuse(device);
  15.  
  16. - CStdString deviceuse;
  17. +
  18. + enum PCMChannels *output_map = ALSAChannelMap;
  19. + if((deviceuse + ":").Left(5) == "hdmi:")
  20. + output_map = HDMIChannelMap;
  21.  
  22. /* setup the channel mapping */
  23. m_uiDataChannels = iChannels;
  24. @@ -76,7 +85,7 @@ bool CALSADirectSound::Initialize(IAudioCallback* pCallback, const CStdString& d
  25. while(outLayout[ch] != PCM_INVALID)
  26. {
  27. for(map = 0; map < 8; ++map)
  28. - if (outLayout[ch] == ALSAChannelMap[map])
  29. + if (outLayout[ch] == output_map[map])
  30. {
  31. if (map > outChannels)
  32. outChannels = map;
  33. @@ -85,7 +94,7 @@ bool CALSADirectSound::Initialize(IAudioCallback* pCallback, const CStdString& d
  34. ++ch;
  35. }
  36.  
  37. - m_remap.SetOutputFormat(++outChannels, ALSAChannelMap);
  38. + m_remap.SetOutputFormat(++outChannels, output_map);
  39. if (m_remap.CanRemap())
  40. {
  41. iChannels = outChannels;
  42. @@ -127,7 +136,6 @@ bool CALSADirectSound::Initialize(IAudioCallback* pCallback, const CStdString& d
  43. snd_config_update();
  44.  
  45. snd_config_t *config = snd_config;
  46. - deviceuse = device;
  47.  
  48. nErr = snd_config_copy(&config, snd_config);
  49. CHECK_ALSA_RETURN(LOGERROR,"config_copy",nErr);
Add Comment
Please, Sign In to add comment