Skip to content

Commit c605579

Browse files
remove margin for filling in audio samples when running below full speed
this seems to reduce the amount of clicking/popping in the audio somewhat
1 parent 42e09ba commit c605579

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/frontend/qt_sdl/EmuInstanceAudio.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ void EmuInstance::audioCallback(void* data, Uint8* stream, int len)
169169

170170
int len_in = inst->audioGetNumSamplesOut(len);
171171
if (len_in > inst->audioBufSize) len_in = inst->audioBufSize;
172-
s16 buf_in[inst->audioBufSize*2];
173172

174173
SDL_LockMutex(inst->audioSyncLock);
175174
int num_in = inst->nds->SPU.ReadOutput((s16*) stream, len_in);
@@ -189,12 +188,11 @@ void EmuInstance::audioCallback(void* data, Uint8* stream, int len)
189188
samples[i] = ((s32) samples[i] * inst->audioVolume) >> 8;
190189
}
191190

192-
int margin = 6;
193-
if (num_in < len_in-margin)
191+
if (num_in < len_in)
194192
{
195193
int last = num_in-1;
196194

197-
for (int i = num_in; i < len_in-margin; i++)
195+
for (int i = num_in; i < len_in; i++)
198196
((u32*)stream)[i] = ((u32*)stream)[last];
199197
}
200198
}

0 commit comments

Comments
 (0)