diff options
author | Trent Nelson <trent.a.b.nelson@gmail.com> | 2014-03-04 10:31:24 -0700 |
---|---|---|
committer | Trent Nelson <trent.a.b.nelson@gmail.com> | 2014-03-04 10:36:29 -0700 |
commit | 9f7de7d622769f619dd7225b59d5f16d64baaef6 (patch) | |
tree | 29a144a3fd4640675a6365fec7ba848bfbf90b72 | |
parent | 34d1b05eadfbb5bac64e1f95d0831917523be7fe (diff) |
[DROID][AE] Don't guess at supported sampling rate
Android will resample to the "native" sample rate defined in firmware so
only use that rate.
-rw-r--r-- | xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp index 1fde9c8511..c1d0d1dc0a 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp @@ -94,19 +94,7 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device) aml_set_audio_passthrough(m_passthrough); #endif - // default to 44100, all android devices support it. - // then check if we can support the requested rate. - unsigned int sampleRate = 44100; - for (size_t i = 0; i < m_info.m_sampleRates.size(); i++) - { - if (m_format.m_sampleRate == m_info.m_sampleRates[i]) - { - sampleRate = m_format.m_sampleRate; - break; - } - } - - m_format.m_sampleRate = sampleRate; + m_format.m_sampleRate = CJNIAudioTrack::getNativeOutputSampleRate(CJNIAudioManager::STREAM_MUSIC); m_format.m_dataFormat = AE_FMT_S16LE; m_format.m_channelLayout = m_info.m_channels; m_format.m_frameSize = m_format.m_channelLayout.Count() * @@ -259,8 +247,7 @@ void CAESinkAUDIOTRACK::EnumerateDevicesEx(AEDeviceInfoList &list, bool force) m_info.m_displayNameExtra = "audiotrack"; m_info.m_channels += AE_CH_FL; m_info.m_channels += AE_CH_FR; - m_info.m_sampleRates.push_back(44100); - m_info.m_sampleRates.push_back(48000); + m_info.m_sampleRates.push_back(CJNIAudioTrack::getNativeOutputSampleRate(CJNIAudioManager::STREAM_MUSIC)); m_info.m_dataFormats.push_back(AE_FMT_S16LE); #if 0 //defined(__ARM_NEON__) if (g_cpuInfo.GetCPUFeatures() & CPU_FEATURE_NEON) |