diff options
author | enselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2008-09-13 12:37:57 +0000 |
---|---|---|
committer | enselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2008-09-13 12:37:57 +0000 |
commit | 28697c059df1f6b276a490123611c439996085c8 (patch) | |
tree | b6740929c6479baa794083434beb6fca8eb02a4d /recordmydesktop/src/register_callbacks.c | |
parent | 3f5d20573bd0aac953bd2db2d72997ff44365caf (diff) |
include/recordmydesktop.h: Remove the globals Paused, Aborted and
PauseStateChanged.
include/rmdtypes.h: Add the previous globals as members in ProgData.
src/rmd_jack.c
src/get_frame.c
src/rmd_timer.c
src/rmd_rescue.c
src/cache_audio.c
src/cache_frame.c
src/capture_sound.c
src/initialize_data.c
src/recordmydesktop.c
src/register_callbacks.c
src/encode_image_buffer.c
src/encode_sound_buffer.c: Adapt.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@529 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/register_callbacks.c')
-rw-r--r-- | recordmydesktop/src/register_callbacks.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/recordmydesktop/src/register_callbacks.c b/recordmydesktop/src/register_callbacks.c index c16f7b1..3371673 100644 --- a/recordmydesktop/src/register_callbacks.c +++ b/recordmydesktop/src/register_callbacks.c @@ -32,36 +32,40 @@ // There seem to be no way of passing user data to the signal handler, // so hack around not being able to pass ProgData to them -static int *pdata_running = NULL; +static int *pdata_running = NULL; +static int *pdata_paused = NULL; +static int *pdata_aborted = NULL; +static int *pdata_pause_state_changed = NULL; static void SetPaused(int signum) { - PauseStateChanged = 1; + *pdata_pause_state_changed = 1; } static void SetRunning(int signum) { - - if (!Paused){ - if (pdata_running != NULL) { - *pdata_running = 0; - } + if (!*pdata_paused) { + + *pdata_running = 0; if (signum == SIGABRT) { - Aborted = 1; + *pdata_aborted = 1; } } } -void RegisterCallbacks(ProgData *pata) { +void RegisterCallbacks(ProgData *pdata) { struct sigaction pause_act; struct sigaction end_act; - // Is there some way to pass pata to the signal handlers? - pdata_running = &pata->running; - + // Is there some way to pass pdata to the signal handlers? + pdata_running = &pdata->running; + pdata_paused = &pdata->paused; + pdata_aborted = &pdata->aborted; + pdata_pause_state_changed = &pdata->pause_state_changed; + // Setup pause_act sigfillset(&pause_act.sa_mask); pause_act.sa_flags = SA_RESTART; |