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

Commit da1a707

Browse files
committed
FIX: [IEC] decent buffer size for HD audio
1 parent 87e7d37 commit da1a707

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
299299
else
300300
{
301301
if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
302+
{
302303
m_encoding = CJNIAudioFormat::ENCODING_IEC61937;
304+
m_sink_sampleRate = 48000;
305+
}
303306
else
304307
m_format.m_dataFormat = AE_FMT_S16LE;
305308
}
@@ -323,7 +326,10 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
323326
else
324327
{
325328
if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
329+
{
326330
m_encoding = CJNIAudioFormat::ENCODING_IEC61937;
331+
// m_sink_sampleRate = 48000;
332+
}
327333
else
328334
m_format.m_dataFormat = AE_FMT_S16LE;
329335
}
@@ -337,7 +343,7 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
337343
if (CJNIAudioFormat::ENCODING_IEC61937 != -1)
338344
{
339345
m_encoding = CJNIAudioFormat::ENCODING_IEC61937;
340-
m_format.m_channelLayout = AE_CH_LAYOUT_2_0;
346+
// m_sink_sampleRate = 48000;
341347
}
342348
else
343349
m_format.m_dataFormat = AE_FMT_S16LE;
@@ -392,6 +398,9 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
392398
}
393399
else
394400
{
401+
if (m_passthrough && m_format.m_sampleRate > 48000)
402+
m_buffer_size = std::max((unsigned int) 65536, m_buffer_size);
403+
395404
m_format.m_frameSize = m_format.m_channelLayout.Count() *
396405
(CAEUtil::DataFormatToBits(m_format.m_dataFormat) / 8);
397406
if (m_passthrough)

xbmc/cores/dvdplayer/DVDPlayerAudio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ void CDVDPlayerAudio::Process()
573573
}
574574

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

0 commit comments

Comments
 (0)