xbmc: add PR2382

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-03-07 11:13:08 +01:00
parent 683ab7ee3d
commit e0280ea6d3

View File

@ -0,0 +1,46 @@
From eb4ae32119a83716d7fb930381d2848c02383cea Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Wed, 6 Mar 2013 07:52:59 +0100
Subject: [PATCH] AE: Fix menu sounds by decreasing buffer(max 200 ms) and
periodSize(50 ms)
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index 821bd2e..21891a5 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -332,18 +332,19 @@ bool CAESinkALSA::InitializeHW(AEAudioFormat &format)
snd_pcm_hw_params_get_period_size_max(hw_params, &periodSize, NULL);
/*
- We want to make sure, that we have approx 500 to 800 ms Buffer with
- a periodSize of approx 100 ms.
- It is calced:
- periodSize = sampleRate / 10
- buffersize = periodSize * 1 frame * 8.
+ We want to make sure, that we have max 200 ms Buffer with
+ a periodSize of approx 50 ms. Choosing a higher bufferSize
+ will cause problems with menu sounds. Buffer will be increased
+ after those are fixed.
+ periodSize = sampleRate / 20
+ bufferSize = periodSize * 1 frame * 4.
*/
- periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 10);
- bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) periodSize * 8);
+ periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 20);
+ bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) periodSize * 4);
/*
- According to upstream we should set buffer size first - so make sure it is always at least
- double of period size to not get underruns
+ According to upstream we should set buffer size first - so make sure it is always at least
+ double of period size to not get underruns
*/
periodSize = std::min(periodSize, bufferSize / 2);
--
1.7.10