Skip to content

Commit

Permalink
FIX: [IEC] decent buffer size for HD audio
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Jul 25, 2016
1 parent 87e7d37 commit da1a707
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
else
{
if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
{
m_encoding = CJNIAudioFormat::ENCODING_IEC61937;
m_sink_sampleRate = 48000;
}
else
m_format.m_dataFormat = AE_FMT_S16LE;
}
Expand All @@ -323,7 +326,10 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
else
{
if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
{
m_encoding = CJNIAudioFormat::ENCODING_IEC61937;
// m_sink_sampleRate = 48000;
}
else
m_format.m_dataFormat = AE_FMT_S16LE;
}
Expand All @@ -337,7 +343,7 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
{
m_encoding = CJNIAudioFormat::ENCODING_IEC61937;
m_format.m_channelLayout = AE_CH_LAYOUT_2_0;
// m_sink_sampleRate = 48000;
}
else
m_format.m_dataFormat = AE_FMT_S16LE;
Expand Down Expand Up @@ -392,6 +398,9 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
}
else
{
if (m_passthrough && m_format.m_sampleRate > 48000)
m_buffer_size = std::max((unsigned int) 65536, m_buffer_size);

m_format.m_frameSize = m_format.m_channelLayout.Count() *
(CAEUtil::DataFormatToBits(m_format.m_dataFormat) / 8);
if (m_passthrough)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDPlayerAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void CDVDPlayerAudio::Process()
}

// Zero out the frame data if we are supposed to silence the audio
if (m_silence || (m_syncclock && !AE_IS_RAW_RAW(audioframe.data_format)))
if (m_silence || (m_syncclock && !AE_IS_RAW(audioframe.data_format)))
{
int size = audioframe.nb_frames * audioframe.framesize / audioframe.planes;
for (unsigned int i=0; i<audioframe.planes; i++)
Expand Down

0 comments on commit da1a707

Please sign in to comment.