Repository navigation
Fix preloaded video behavior - #3206
Merged
Merged
Conversation
The previous preloaded video behavior updated the texture on preload rather than when the video was shown, during which time the texture may have been modified by other processes, resulting in the wrong frame being displayed.
This prevents a stale texture from being visible for a single frame when there is no preloaded video.
|
Noobish question: Is it appropriate to post here just to say thank you? Thank you! :) |
|
Noob question: how do I get an OBS version with this fix? if it requires compiling, I have no clue how to do that |
Member
Author
|
Use any version after this was merged. |
I'm using the latest version 29.1.3 and the problem persists. :/ The last frame still flashes when switching scenes, when restart playback is checked. |
Member
Author
|
I suggest opening a new issue with full reproduction steps. |
BlueCheeseburger
pushed a commit
to BlueCheeseburger/obs-studio
that referenced
this pull request
Aug 22, 2026
Fix preloaded video behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR changes the preloading / async texture behavior in libobs.
obs_source_show_preloaded_videonow updates the texture when called instead of whenobs_source_preload_videois called. As the only user ofobs_source_preload_video, obs-ffmpeg was changed to only callobs_source_show_preloaded_videoif video was actually preloaded.Motivation and Context
Fixes broken(?) API behavior - the current behavior of
obs_source_preload_video/obs_source_show_preloaded_videocan fail if something else writes to the async texture in between the preload / show calls. This code is hopefully closer to what the functions were intended to do.Fixes #2906
How Has This Been Tested?
Tested with a Media Source using a 1 FPS video with "show nothing when playback ends" and "restart playback when active" selected. No more stale frames were shown when switching scenes. Further testing may be needed as while obs-ffmpeg is the only in-tree user of
obs_source_preload_video, this is still an API change that might affect plugins that call this function.Types of changes
Checklist: