From 5d0c7949f5adc81d3423f1d78d6888db4168e9eb Mon Sep 17 00:00:00 2001 From: c0ntrol Date: Sat, 8 Sep 2018 21:28:20 +0200 Subject: [PATCH] fix FPE in division (0.5 becomes 0) --- veejay-current/veejay-client/src/vj-api.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/veejay-current/veejay-client/src/vj-api.c b/veejay-current/veejay-client/src/vj-api.c index 67a0efd0..b579d419 100644 --- a/veejay-current/veejay-client/src/vj-api.c +++ b/veejay-current/veejay-client/src/vj-api.c @@ -6698,12 +6698,17 @@ static void update_globalinfo(int *history, int pm, int last_pm) int deckpage = gtk_notebook_get_current_page( GTK_NOTEBOOK( ww )); if(deckpage != 1) { - if( (reload_entry_tick_ % ((int)info->el.fps/2))==0) + int rate = 1; + if( info->el.fps > 1 ) { + rate = info->el.fps/2; + } + + if( (reload_entry_tick_ % rate)==0) { info->uc.reload_hint[HINT_ENTRY] = 1; } if( deckpage == 5 && info->status_tokens[STREAM_TYPE] == STREAM_GENERATOR){ - if( (reload_entry_tick_ % ((int)info->el.fps/2))==0) + if( (reload_entry_tick_ % rate)==0) { info->uc.reload_hint[HINT_GENERATOR] = 1; }