image-source: Reload file when timestamp has changed #617
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes the issue outlined in the following thread:
https://obsproject.com/forum/threads/check-for-file-changes-on-images.50045/
When the image source file was replaced by an outside process, it would only reload when the file's new timestamp was newer than the file's previous timestamp. If you're copying image files onto a common file name (for example, "C:\obs-stuff\image.jpg"), and you have an Image Source targeting that common file name, then this could cause the image source to get stuck on the image that has the newest timestamp. This fixes that behavior. Now an image source will reload any time the file's new timestamp is different than its previous timestamp.
I've built and tested this change on Windows 10 64-bit. I welcome additional testing or feedback.