mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-03 20:30:58 +00:00
xa.cpp: Fix the crackling noise.
git-svn-id: https://svn.eduke32.com/eduke32@6763 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
5f52049948
commit
6acbb77ac5
1 changed files with 7 additions and 2 deletions
|
@ -285,7 +285,10 @@ void MV_SetXAPosition(VoiceNode *voice, int32_t position)
|
|||
xa_data * xad = (xa_data *) voice->rawdataptr;
|
||||
|
||||
if (position < XA_DATA_START || (size_t)position >= xad->length)
|
||||
{
|
||||
position = XA_DATA_START;
|
||||
xad->t1 = xad->t2 = xad->t1_x = xad->t2_x = 0;
|
||||
}
|
||||
|
||||
xad->pos = position;
|
||||
}
|
||||
|
@ -308,8 +311,6 @@ static playbackstatus MV_GetNextXABlock
|
|||
|
||||
voice->Playing = TRUE;
|
||||
|
||||
xad->t1 = xad->t2 = xad->t1_x = xad->t2_x = 0;
|
||||
|
||||
do
|
||||
{
|
||||
size_t bytes = xad->length - xad->pos;
|
||||
|
@ -348,7 +349,10 @@ static playbackstatus MV_GetNextXABlock
|
|||
if (xad->length == xad->pos)
|
||||
{
|
||||
if (voice->LoopSize > 0)
|
||||
{
|
||||
xad->pos = XA_DATA_START;
|
||||
xad->t1 = xad->t2 = xad->t1_x = xad->t2_x = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
voice->Playing = FALSE;
|
||||
|
@ -454,6 +458,7 @@ int32_t MV_PlayXA
|
|||
|
||||
xad->ptr = ptr;
|
||||
xad->pos = XA_DATA_START;
|
||||
xad->t1 = xad->t2 = xad->t1_x = xad->t2_x = 0;
|
||||
xad->blocksize = 0;
|
||||
xad->length = ptrlength;
|
||||
|
||||
|
|
Loading…
Reference in a new issue