From 054148a0af26ee346d4fec2e0d56bfb010b0c5db Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 14 Jun 2017 08:30:44 -0700 Subject: [PATCH] obs-ffmpeg: Don't preload media frames if set to pause on end Preloading is designed to overwrite the current internal render texture of the source so it'll be ready to play the first frame right when the source is first displayed. However, When the media source is set to pause on the last frame, it keeps that current render texture visible, so preloading it with the first frame will essentially overwrite the current render, causing it to inadvertently show and pause on the first frame rather than the last frame. So instead, just disable preloading when the user has it set to pause on the last frame. --- plugins/obs-ffmpeg/obs-ffmpeg-source.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-source.c b/plugins/obs-ffmpeg/obs-ffmpeg-source.c index 7149edec8..bbe16018f 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-source.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-source.c @@ -218,7 +218,8 @@ 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; - obs_source_preload_video(s->source, f); + if (s->is_clear_on_media_end || s->is_looping) + obs_source_preload_video(s->source, f); } static void get_audio(void *opaque, struct obs_source_audio *a)