Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
FIX: [AT] low samplerate audio
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Mar 20, 2016
1 parent 2f74b09 commit dc3deb2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
m_passthrough = true;

// Get equal or lower supported sample rate
std::set<unsigned int>::iterator s = m_sink_sampleRates.upper_bound(m_format.m_encodedRate);
if (--s != m_sink_sampleRates.begin())
m_sink_sampleRate = *s;
std::set<unsigned int>::iterator s = m_sink_sampleRates.upper_bound((AE_IS_RAW_RAW(m_format.m_dataFormat) ? m_format.m_encodedRate : m_format.m_sampleRate));
if (s != m_sink_sampleRates.end() && s != m_sink_sampleRates.begin())
m_sink_sampleRate = *(--s);
else
m_sink_sampleRate = CJNIAudioTrack::getNativeOutputSampleRate(CJNIAudioManager::STREAM_MUSIC);

Expand Down Expand Up @@ -337,8 +337,8 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)

// Get equal or lower supported sample rate
std::set<unsigned int>::iterator s = m_sink_sampleRates.upper_bound(m_format.m_sampleRate);
if (--s != m_sink_sampleRates.begin())
m_sink_sampleRate = *s;
if (s != m_sink_sampleRates.end() && s != m_sink_sampleRates.begin())
m_sink_sampleRate = *(--s);
else
m_sink_sampleRate = CJNIAudioTrack::getNativeOutputSampleRate(CJNIAudioManager::STREAM_MUSIC);

Expand Down

0 comments on commit dc3deb2

Please sign in to comment.