summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recordmydesktop/src/register_callbacks.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/recordmydesktop/src/register_callbacks.c b/recordmydesktop/src/register_callbacks.c
index 545c576..8a9105f 100644
--- a/recordmydesktop/src/register_callbacks.c
+++ b/recordmydesktop/src/register_callbacks.c
@@ -90,9 +90,16 @@ void RegisterCallbacks(ProgArgs *args){
struct itimerval value;
struct sigaction time_act,pause_act,end_act;
+
+ if(args->fps!=1){
+ value.it_interval.tv_sec=value.it_value.tv_sec=0;
+ value.it_interval.tv_usec=value.it_value.tv_usec=(1000000)/args->fps;
+ }
+ else{
+ value.it_interval.tv_sec=value.it_value.tv_sec=1;
+ value.it_interval.tv_usec=value.it_value.tv_usec=0;
+ }
- value.it_interval.tv_sec=value.it_value.tv_sec=0;
- value.it_interval.tv_usec=value.it_value.tv_usec=(1000000)/args->fps;
setitimer(ITIMER_REAL,&value,NULL);
time_act.sa_handler=SetExpired;
pause_act.sa_handler=SetPaused;
© All Rights Reserved