summaryrefslogtreecommitdiff
path: root/audio.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-04-11 12:03:38 +0200
committerJohns <johns98@gmx.net>2013-04-11 12:03:38 +0200
commit9dd248f9d0ad9df9cc3413b2ba92dcbc03aa8fd3 (patch)
tree22c355b8eaeb15e0c82fdf37aeb5ea61afd0772e /audio.c
parent238224efc84ab2eb66f7328c19c3f815626c50aa (diff)
downloadvdr-plugin-softhddevice-9dd248f9d0ad9df9cc3413b2ba92dcbc03aa8fd3.tar.gz
vdr-plugin-softhddevice-9dd248f9d0ad9df9cc3413b2ba92dcbc03aa8fd3.tar.bz2
Enable seamless audio track change.
Diffstat (limited to 'audio.c')
-rw-r--r--audio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/audio.c b/audio.c
index ae64361..fa518d5 100644
--- a/audio.c
+++ b/audio.c
@@ -678,8 +678,7 @@ static int AudioRingAdd(unsigned sample_rate, int channels, int passthrough)
}
AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX;
- // FIXME: don't flush buffers here
- AudioRing[AudioRingWrite].FlushBuffers = 1;
+ AudioRing[AudioRingWrite].FlushBuffers = 0;
AudioRing[AudioRingWrite].Passthrough = passthrough;
AudioRing[AudioRingWrite].PacketSize = 0;
AudioRing[AudioRingWrite].InSampleRate = sample_rate;
@@ -689,6 +688,9 @@ static int AudioRingAdd(unsigned sample_rate, int channels, int passthrough)
AudioRing[AudioRingWrite].PTS = INT64_C(0x8000000000000000);
RingBufferReset(AudioRing[AudioRingWrite].RingBuffer);
+ Debug(3, "audio: %d ring buffer prepared\n",
+ atomic_read(&AudioRingFilled) + 1);
+
atomic_inc(&AudioRingFilled);
#ifdef USE_AUDIO_THREAD
@@ -2417,6 +2419,7 @@ void AudioFlushBuffers(void)
int i;
old = AudioRingWrite;
+ // FIXME: check ring buffer overflow
AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX;
AudioRing[AudioRingWrite].FlushBuffers = 1;
AudioRing[AudioRingWrite].Passthrough = AudioRing[old].Passthrough;