Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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.
  • Loading branch information...
commit 9f7de7d622769f619dd7225b59d5f16d64baaef6 1 parent 34d1b05
Trent Nelson authored
Showing with 2 additions and 15 deletions.
  1. +2 −15 xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
17 xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.