mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-16 08:06:19 +00:00
Fix garbled audio playing at the start of each stream after the first one
This commit is contained in:
parent
13c22ea16f
commit
f4eca63944
@ -11,8 +11,8 @@
|
||||
// at a time.
|
||||
|
||||
static short s_CircularBuffer[CIRCULAR_BUFFER_SIZE][FRAME_SIZE * MAX_CHANNEL_COUNT];
|
||||
static int s_ReadIndex = 0;
|
||||
static int s_WriteIndex = 0;
|
||||
static int s_ReadIndex;
|
||||
static int s_WriteIndex;
|
||||
|
||||
static void AudioPlayerSampleCallback(void* samples, uint32_t buffer_size, void* data) {
|
||||
// It should only ask us for complete buffers
|
||||
@ -36,6 +36,9 @@ static void AudioPlayerSampleCallback(void* samples, uint32_t buffer_size, void*
|
||||
|
||||
int MoonlightInstance::AudDecInit(int audioConfiguration, POPUS_MULTISTREAM_CONFIGURATION opusConfig, void* context, int flags) {
|
||||
int rc;
|
||||
|
||||
// Reset the ring buffer to empty
|
||||
s_ReadIndex = s_WriteIndex = 0;
|
||||
|
||||
g_Instance->m_OpusDecoder = opus_multistream_decoder_create(opusConfig->sampleRate,
|
||||
opusConfig->channelCount,
|
||||
|
Loading…
x
Reference in New Issue
Block a user