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
master
sorayuki 2018-02-24 11:24:26 +08:00 committed by jp9000
parent c210f1042f
commit e00e081111
1 changed files with 14 additions and 0 deletions

View File

@ -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) {