diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index ba82ac073..f38e22a1d 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -540,8 +540,9 @@ SND_GetSoundtime (void) // it is possible to miscount buffers if it has wrapped twice between // calls to SND_Update. Oh well. - samplepos = snd_output_funcs->pS_O_GetDMAPos (); - + if ((samplepos = snd_output_funcs->pS_O_GetDMAPos ()) == -1) + return; + if (samplepos < oldsamplepos) { buffers++; // buffer wrapped