diff --git a/ultragrid/src/video_display/sage.c b/ultragrid/src/video_display/sage.c index 84f934cf5..6429d004a 100644 --- a/ultragrid/src/video_display/sage.c +++ b/ultragrid/src/video_display/sage.c @@ -67,6 +67,7 @@ #include "video_display/sage_wrapper.h" #include +#include #include @@ -120,13 +121,13 @@ void display_sage_run(void *arg) pthread_cond_broadcast(&s->buffer_writable_cond); pthread_mutex_unlock(&s->buffer_writable_lock); - double seconds = tv_diff(t, t0); + double seconds = tv_diff(s->t, s->t0); if (seconds >= 5) { - float fps = frames / seconds; + float fps = s->frames / seconds; fprintf(stderr, "[SAGE] %d frames in %g seconds = %g FPS\n", - frames, seconds, fps); - t0 = t; - frames = 0; + s->frames, seconds, fps); + s->t0 = s->t; + s->frames = 0; } } }