summaryrefslogtreecommitdiff
path: root/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio.c')
-rw-r--r--audio.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/audio.c b/audio.c
index 2142b5a..6c41503 100644
--- a/audio.c
+++ b/audio.c
@@ -137,8 +137,7 @@ static unsigned AudioSampleRate; ///< audio sample rate in hz
static unsigned AudioChannels; ///< number of audio channels
static const int AudioBytesProSample = 2; ///< number of bytes per sample
static int64_t AudioPTS; ///< audio pts clock
-static const int AudioBufferTime = 300; ///< audio buffer time in ms
-static int AudioMoreBufferTime = 1; ///< increase buffer time
+static const int AudioBufferTime = 450; ///< audio buffer time in ms
#ifdef USE_AUDIO_THREAD
static pthread_t AudioThread; ///< audio play thread
@@ -1087,13 +1086,11 @@ static int AlsaSetup(int *freq, int *channels, int use_ac3)
AlsaStartThreshold = snd_pcm_frames_to_bytes(AlsaPCMHandle, period_size);
// buffer time/delay in ms
if (AlsaStartThreshold <
- (*freq * *channels * AudioBytesProSample * AudioMoreBufferTime *
- AudioBufferTime) / 1000U) {
+ (*freq * *channels * AudioBytesProSample * AudioBufferTime) / 1000U) {
AlsaStartThreshold =
- (*freq * *channels * AudioBytesProSample * AudioMoreBufferTime *
- AudioBufferTime) / 1000U;
+ (*freq * *channels * AudioBytesProSample * AudioBufferTime) /
+ 1000U;
}
- AudioMoreBufferTime = 1;
// no bigger, than the buffer
if (AlsaStartThreshold > RingBufferFreeBytes(AlsaRingBuffer)) {
AlsaStartThreshold = RingBufferFreeBytes(AlsaRingBuffer);
@@ -1712,13 +1709,12 @@ static int OssSetup(int *freq, int *channels, int use_ac3)
OssStartThreshold = bi.bytes + tmp;
// buffer time/delay in ms
if (OssStartThreshold <
- (*freq * *channels * AudioBytesProSample * AudioMoreBufferTime *
- AudioBufferTime) / 1000U) {
+ (*freq * *channels * AudioBytesProSample * AudioBufferTime) /
+ 1000U) {
OssStartThreshold =
- (*freq * *channels * AudioBytesProSample *
- AudioMoreBufferTime * AudioBufferTime) / 1000U;
+ (*freq * *channels * AudioBytesProSample * AudioBufferTime) /
+ 1000U;
}
- AudioMoreBufferTime = 1;
// no bigger, than the buffer
if (OssStartThreshold > RingBufferFreeBytes(OssRingBuffer)) {
OssStartThreshold = RingBufferFreeBytes(OssRingBuffer);
@@ -2102,16 +2098,6 @@ int AudioSetup(int *freq, int *channels, int use_ac3)
}
/**
-** Increase audio buffer time.
-**
-** Some channels need a bigger audio buffer to buffer video.
-*/
-void AudioIncreaseBufferTime(void)
-{
- AudioMoreBufferTime = 4;
-}
-
-/**
** Set pcm audio device.
**
** @param device name of pcm device (fe. "hw:0,9" or "/dev/dsp")