From b787c796cd395e1440d6cfdceda19f84b3b9d169 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 19 Jun 2017 22:58:01 -0700 Subject: [PATCH] obs-ffmpeg: Do not precache if set to close when inactive In the media source, do not pre-cache frames if the source is set to close the file when inactive because that setting is designed to allow the file to be replaced by the user. If it's replaced, it can unintentionally keep the old precache frame, playing the frame from the older video when it starts up. --- plugins/obs-ffmpeg/obs-ffmpeg-source.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-source.c b/plugins/obs-ffmpeg/obs-ffmpeg-source.c index bbe16018f..7aaade027 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-source.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-source.c @@ -218,6 +218,9 @@ static void get_frame(void *opaque, struct obs_source_frame *f) static void preload_frame(void *opaque, struct obs_source_frame *f) { struct ffmpeg_source *s = opaque; + if (s->close_when_inactive) + return; + if (s->is_clear_on_media_end || s->is_looping) obs_source_preload_video(s->source, f); }