From e52adeabb3d885edf6e176a5bff24afc1ae9fcd3 Mon Sep 17 00:00:00 2001 From: iovar Date: Wed, 22 Nov 2006 11:05:32 +0000 Subject: 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 --- recordmydesktop/src/register_callbacks.c | 22 ++++++++++++---------- 1 file 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 +#include 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); -- cgit v1.2.1