From 3f5d20573bd0aac953bd2db2d72997ff44365caf Mon Sep 17 00:00:00 2001 From: enselic Date: Sat, 13 Sep 2008 11:39:35 +0000 Subject: The global int pointer 'Running' is just a hack for global access of ProgData::running. We can get rid of this global. include/rmdtypes.h: Put ProgData in JackData so that the libjack stuff can access progam state. src/recordmydesktop.c: Initialize ProgData member of JackData. src/rmd_jack.c: Use ProgData instead of the global. src/register_callbacks.[ch]: Pass ProgData to the registering of signal handlers and put a local version of the Running-global hack in this file. src/rmd_rescue.c: Get rid of Running-logic and pass ProgData to RegisterCallbacks() src/rmdthreads.c: Pass ProgData to RegisterCallbacks() src/initialize_data.c: Get rid of Running-logic. include/recordmydesktop.h: Remove the Running-global. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@528 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/rmd_jack.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'recordmydesktop/src/rmd_jack.c') diff --git a/recordmydesktop/src/rmd_jack.c b/recordmydesktop/src/rmd_jack.c index ed03a8a..1718c09 100644 --- a/recordmydesktop/src/rmd_jack.c +++ b/recordmydesktop/src/rmd_jack.c @@ -91,8 +91,10 @@ static int JackCapture(jack_nframes_t nframes,void *jdata_t) { int i=0; JackData *jdata=(JackData *)jdata_t; - if((!*Running)||(Paused) || (!jdata->capture_started)) + if (!jdata->pdata->running || Paused || !jdata->capture_started) { return 0; + } + for(i= 0;inports;i++) jdata->portbuf[i]=jack_port_get_buffer_p(jdata->ports[i],nframes); //vorbis analysis buffer wants uninterleaved data @@ -206,8 +208,11 @@ static int LoadJackLib(void *jack_lib_handle) { //encode the result(if not on the fly) //an exit cleanly. static void JackShutdown(void *jdata_t) { + JackData *jdata = (JackData *)jdata_t; + + jdata->pdata->running = 0; + fprintf (stderr, "JACK shutdown\n"); - *Running=0; } int StartJackClient(JackData *jdata){ -- cgit v1.2.3