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:
@ -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 ////////////////////////////////////////////////////////
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user