Closed aargirakis closed 6 months ago
@aargirakis
I'm having similar problems (I was developing a Godot Engine module to playback .sndh files).
In addition to initializing both m_dcAdjustPos
and m_dcAdjustSum
, I found that clearing the m_dcAdjustBuffer
fixed some things.
memset(m_dcAdjustBuffer,0,sizeof(m_dcAdjustBuffer));
I'm a C++ noob, so that might be wrong, or be unsound advice :)
@turbohz Well, whaddayaknow! That fixed my issues, it seems, thanks!
good catch! I just fixed it in main branch, thanks
I've added snd-player to BZR Player. I got random crashes maybe every 10th play and saw that in ym2149c.cpp the variables m_dcAdjustPos and m_dcAdjustSum is increased/decreased in dcAdjust() but they are never initialized to 0 in Reset(). After I initialized them I had no more crashes. However some files (or randomly) the sound gets distorted, I'm just guessing that there are maybe more uninitialized variable thay my cause that.