1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-19 11:49:09 +00:00

Fix parentheses mistake for retrieving streaming audio timings and apply code fix suggestions from Adam

This commit is contained in:
ZarothYe
2022-02-26 19:16:00 -06:00
parent 64323c6073
commit 126d7511e0
4 changed files with 8 additions and 5 deletions

View File

@ -712,7 +712,7 @@ hsBool plDSoundBuffer::IsEAXAccelerated( void ) const
UInt32 plDSoundBuffer::BytePosToMSecs(UInt32 bytePos) const
{
return (UInt32)(bytePos / ((hsScalar)fBufferDesc->fAvgBytesPerSec) / 1000.0f);
return (UInt32)(bytePos / ((float)fBufferDesc->fAvgBytesPerSec / 1000.0f));
}
//// GetBufferBytePos ////////////////////////////////////////////////////////

View File

@ -114,7 +114,8 @@ void plWin32Sound::Update()
if (plgAudioSys::AreSubtitlesEnabled() && buf != nullptr) {
plSrtFileReader* srtReader = buf->GetSrtReader();
if (srtReader != nullptr) {
while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime((uint32_t)(GetActualTimeSec() * 1000.0f))) {
uint32_t currentTimeMs = (uint32_t)(GetActualTimeSec() * 1000.0f);
while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime(currentTimeMs)) {
// add a plSubtitleMsg to go... to whoever is listening (probably the KI)
plSubtitleMsg* msg = new plSubtitleMsg(nextEntry->GetSubtitleText(), nextEntry->GetSpeakerName());
msg->Send();