AudioPlayHead::CurrentPositionInfo::timeInSamples is occasionally off by one on some hosts (for example reproduces on REAPER 4.31/x64 on Windows).
This happens because VstTimeInfo::samplePos is given as a “double”, and for example, is sometimes given as 1023.9999999 instead of 1024.
I’m guessing this may be due to hosts internally storing it as time in seconds and converting it to samples via a multiplication.
To fix this problem I changed in the VST wrapper, the line:
info.timeInSamples = (int64) ti->samplePos;
info.timeInSamples = (int64) (ti->samplePos + 0.5);
Happy New Years! Yair