diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-11-22 11:05:32 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2006-11-22 11:05:32 +0000 |
commit | e52adeabb3d885edf6e176a5bff24afc1ae9fcd3 (patch) | |
tree | de16499300f384fc96e99bb81b571f6a08a9d9bf | |
parent | 7656b67d305debc2d8a832684f396712360ac363 (diff) |
fix for paused condition, stop counting total frames
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@195 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r-- | recordmydesktop/src/register_callbacks.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/recordmydesktop/src/register_callbacks.c b/recordmydesktop/src/register_callbacks.c index 08c528f..730c47a 100644 --- a/recordmydesktop/src/register_callbacks.c +++ b/recordmydesktop/src/register_callbacks.c @@ -25,15 +25,17 @@ **********************************************************************************/ -#include <recordmydesktop.h> +#include <recordmydesktop.h> void SetExpired(int signum){ - frames_total++; - if(capture_busy){ - frames_lost++; + if(!Paused){ + frames_total++; + if(capture_busy){ + frames_lost++; + } + pthread_cond_broadcast(time_cond);//sig handlers should not call this func + //could be a set_expired and main thread + //doing a while(running) if set_expired broadcast else usleep(n) } - pthread_cond_broadcast(time_cond);//sig handlers should not call this func - //could be a set_expired and main thread - //doing a while(running) if set_expired broadcast else usleep(n) } void SetPaused(int signum){ @@ -78,9 +80,9 @@ void RegisterCallbacks(ProgArgs *args){ time_act.sa_handler=SetExpired; pause_act.sa_handler=SetPaused; end_act.sa_handler=SetRunning; - sigfillset(&(time_act.sa_mask)); - sigfillset(&(pause_act.sa_mask)); - sigfillset(&(end_act.sa_mask)); + sigfillset(&(time_act.sa_mask)); + sigfillset(&(pause_act.sa_mask)); + sigfillset(&(end_act.sa_mask)); time_act.sa_flags=pause_act.sa_flags=end_act.sa_flags=0; sigaction(SIGALRM,&time_act,NULL); sigaction(SIGUSR1,&pause_act,NULL); |