Enable seamless audio track change.

This commit is contained in:
Johns 2013-04-11 12:03:38 +02:00
parent 238224efc8
commit 9dd248f9d0
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
User johns User johns
Date: Date:
Enable seamless audio track change.
Fix bug #1302: Unsupported pixel format crash. Fix bug #1302: Unsupported pixel format crash.
Fix the fix, when sillpicture is called in suspend mode. Fix the fix, when sillpicture is called in suspend mode.
Fix crash, when sillpicture is called in suspend mode. Fix crash, when sillpicture is called in suspend mode.

View File

@ -678,8 +678,7 @@ static int AudioRingAdd(unsigned sample_rate, int channels, int passthrough)
} }
AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX; AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX;
// FIXME: don't flush buffers here AudioRing[AudioRingWrite].FlushBuffers = 0;
AudioRing[AudioRingWrite].FlushBuffers = 1;
AudioRing[AudioRingWrite].Passthrough = passthrough; AudioRing[AudioRingWrite].Passthrough = passthrough;
AudioRing[AudioRingWrite].PacketSize = 0; AudioRing[AudioRingWrite].PacketSize = 0;
AudioRing[AudioRingWrite].InSampleRate = sample_rate; 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); AudioRing[AudioRingWrite].PTS = INT64_C(0x8000000000000000);
RingBufferReset(AudioRing[AudioRingWrite].RingBuffer); RingBufferReset(AudioRing[AudioRingWrite].RingBuffer);
Debug(3, "audio: %d ring buffer prepared\n",
atomic_read(&AudioRingFilled) + 1);
atomic_inc(&AudioRingFilled); atomic_inc(&AudioRingFilled);
#ifdef USE_AUDIO_THREAD #ifdef USE_AUDIO_THREAD
@ -2417,6 +2419,7 @@ void AudioFlushBuffers(void)
int i; int i;
old = AudioRingWrite; old = AudioRingWrite;
// FIXME: check ring buffer overflow
AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX; AudioRingWrite = (AudioRingWrite + 1) % AUDIO_RING_MAX;
AudioRing[AudioRingWrite].FlushBuffers = 1; AudioRing[AudioRingWrite].FlushBuffers = 1;
AudioRing[AudioRingWrite].Passthrough = AudioRing[old].Passthrough; AudioRing[AudioRingWrite].Passthrough = AudioRing[old].Passthrough;