Skip to content

bug: image-source: an image replaced within the same second is still missed on Windows (follow-up to #548) #564

Closed

Description

@rdoupe

Follow-up to #548 (our fix for upstream obsproject/obs-studio#10700, reported by chocobclyn on Windows 11): #548 only covers Linux and macOS for images replaced by one of the same size.

What is left

#548 made the Image source compare the sub-second part of its file's modification time and the file size, so an image replaced within the same second is reloaded. The sub-second part comes from stat() on Linux and macOS. On Windows, libobs's os_stat() copies _wstat()'s st_mtime, whole seconds only, so there an image replaced by one of the same size within the same second is still missed and the old image stays on screen. The reporter is on Windows.

Location

Class

Our own incomplete fix (OUR MESS): the original bug remains on the reporter's platform for same-size replacements.

Proposed fix and failing test

Fix: on Windows, read the last write time and size with GetFileAttributesExW() (100 ns ticks) in a Windows-only image-file-version-win32.c, converted by a plain image_file_version_from_filetime(); Linux and macOS keep stat().

RED test (test_image_file_version_filetime, every platform, no graphics): two write times 0.4 s apart in the same second must give different versions, and the sub-second part must be kept to the 100 ns tick (both fail today: whole seconds only); controls: whole seconds convert to the Unix time stat() reports, and a real file is read (on Windows through the new code, so the Windows Tier 2 lane compiles and runs it).

Not run on Windows: we have no Windows machine. The conversion is tested on Linux; the Windows file was only checked for syntax against the documented Win32 declarations, and CI's Windows Tier 2 lane will be its first real build and run.

Activity

  1. rdoupe commented on Oct 13, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: this issue.

    1. RED: test_image_file_version_filetime (2 of 4 failing): a Windows file time keeps whole seconds only.
    2. GREEN: read the last write time with GetFileAttributesExW() on Windows (image-file-version-win32.c); Linux and macOS unchanged.
      PR today. Not run on Windows here; the Windows Tier 2 lane builds and runs the new code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions