Forráskód Böngészése

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.
jp9000 8 éve
szülő
commit
b787c796cd
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      plugins/obs-ffmpeg/obs-ffmpeg-source.c

+ 3 - 0
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);
 }