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.
master
jp9000 2017-06-19 22:58:01 -07:00
parent 603825ee39
commit b787c796cd
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}