mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 10:14:13 -05:00
libobs: Free async cache when sources output NULL frames
When sources output NULL frames, it is generally used to disable the source and prevent the last frame from being left on screen. However, when the source begins outputting video again, the last frame is still in the async cache. Depending on the stability of the source's frame output, this still frame can end up being shown for 5+ output frames. By freeing the async cache when a NULL frame is submitted, we avoid the issue of old frames being re-displayed.
This commit is contained in:
@@ -2940,7 +2940,11 @@ obs_source_output_video_internal(obs_source_t *source,
|
||||
return;
|
||||
|
||||
if (!frame) {
|
||||
pthread_mutex_lock(&source->async_mutex);
|
||||
source->async_active = false;
|
||||
source->last_frame_ts = 0;
|
||||
free_async_cache(source);
|
||||
pthread_mutex_unlock(&source->async_mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user