Skip to content

Commit be496a8

Browse files
committed
Fixed silent sounds on first play, stereo and precached only
https://mantis.zdoom.org/view.php?id=637
1 parent 79654fa commit be496a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/s_sound.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,9 +1488,11 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
14881488

14891489
DPrintf(DMSG_NOTIFY, "Loading monoized sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
14901490

1491+
std::pair<SoundHandle, bool> snd;
1492+
14911493
if (pBuffer->mBuffer.Size() > 0)
14921494
{
1493-
GSnd->LoadSoundBuffered(pBuffer, true);
1495+
snd = GSnd->LoadSoundBuffered(pBuffer, true);
14941496
}
14951497
else
14961498
{
@@ -1501,7 +1503,6 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
15011503
uint8_t *sfxdata = new uint8_t[size];
15021504
wlump.Read(sfxdata, size);
15031505
int32_t dmxlen = LittleLong(((int32_t *)sfxdata)[1]);
1504-
std::pair<SoundHandle, bool> snd;
15051506

15061507
// If the sound is voc, use the custom loader.
15071508
if (strncmp((const char *)sfxdata, "Creative Voice File", 19) == 0)
@@ -1526,9 +1527,9 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
15261527
snd = GSnd->LoadSound(sfxdata, size, true, pBuffer);
15271528
}
15281529
delete[] sfxdata;
1529-
1530-
sfx->data3d = snd.first;
15311530
}
1531+
1532+
sfx->data3d = snd.first;
15321533
}
15331534

15341535
//==========================================================================

0 commit comments

Comments
 (0)