MyStreamTimer
MyStreamTimer copied to clipboard
Changed WriteTimeToDisk to update countdown.txt indirectly
Instead of writing the text directly to countdown.txt, this change instead writes to a temp file, then renames countdown.txt to another temp file, renames the original temp back to countdown.txt, and deletes the old countdown.txt. The expectation is that rename file operations are less likely to generate conflicts when the countdown file is accessed by OBS and MyStreamTimer. This is admittedly hard to test - the glitches can be a single lost second, or longer periods where the stream seems frozen for several seconds. With this change, I still see about 4 or 5 instances of a single lost second in a 5 minute timer, but this would also vary by machine. When testing, I set the Timer to 100 milliseconds, since a more frequent update interval won't generate conflicts using this code change. May help resolve issue #26
Are you able to rebase off latest changes? I can give it a test.