diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | audio.c | 7 |
2 files changed, 6 insertions, 2 deletions
@@ -1,6 +1,7 @@ User johns Date: + Enable seamless audio track change. Fix bug #1302: Unsupported pixel format crash. Fix the fix, when sillpicture is called in suspend mode. Fix crash, when sillpicture is called in suspend mode. @@ -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; |