diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-11-29 20:39:14 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-11-29 20:39:14 +0000 |
commit | b0bd03bd035d1a6b5f6d5a2021d39432d270fa6a (patch) | |
tree | 7c17ed7ddc1c2162c0a050ee7525601680b2195b /recordmydesktop | |
parent | 647adf14246b5a123dcb8e0cb9a37db3a5bca871 (diff) |
proper fix for framerates <=1
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@442 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop')
-rw-r--r-- | recordmydesktop/src/register_callbacks.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/recordmydesktop/src/register_callbacks.c b/recordmydesktop/src/register_callbacks.c index 8a9105f..8db5d5d 100644 --- a/recordmydesktop/src/register_callbacks.c +++ b/recordmydesktop/src/register_callbacks.c @@ -91,14 +91,8 @@ void RegisterCallbacks(ProgArgs *args){ 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=1/args->fps; + value.it_interval.tv_usec=value.it_value.tv_usec=(1000000)/args->fps-value.it_value.tv_sec*1000000; setitimer(ITIMER_REAL,&value,NULL); time_act.sa_handler=SetExpired; |