From e00e081111d62520c345bcd43b9df2639553f21f Mon Sep 17 00:00:00 2001 From: sorayuki Date: Sat, 24 Feb 2018 11:24:26 +0800 Subject: [PATCH] image-source: Fade to transparency if slideshow list is cleared Fixes a bug where the last image would be permanently shown if the user clears the file list of a slideshow source. Closes jp9000/obs-studio#1206 --- plugins/image-source/obs-slideshow.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/image-source/obs-slideshow.c b/plugins/image-source/obs-slideshow.c index e805d69b6..e8316e93f 100644 --- a/plugins/image-source/obs-slideshow.c +++ b/plugins/image-source/obs-slideshow.c @@ -657,6 +657,20 @@ static void ss_video_tick(void *data, float seconds) if (ss->pause_on_deactivate || ss->manual || ss->stop || ss->paused) return; + /* ----------------------------------------------------- */ + /* fade to transparency when the file list becomes empty */ + if (!ss->files.num) { + obs_source_t* active_transition_source = + obs_transition_get_active_source(ss->transition); + + if (active_transition_source) { + obs_source_release(active_transition_source); + do_transition(ss, true); + } + } + + /* ----------------------------------------------------- */ + /* do transition when slide time reached */ ss->elapsed += seconds; if (ss->elapsed > ss->slide_time) {