summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rmdthreads.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-02-07 18:44:02 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-02-07 18:44:02 +0000
commit9c05582a007788295d872172c5109ae9bccfcf68 (patch)
tree6c2275255f4c38d819b27da2978e7f74715c8050 /recordmydesktop/src/rmdthreads.c
parentf39f779f299cd78a574999830699e30f92932f06 (diff)
Added support for recording audio through jack.
libjack is dlopened so there's no runtime dependency on it. Ports must be connected at startup. New files: src/rmd_jack.c git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@273 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rmdthreads.c')
-rw-r--r--recordmydesktop/src/rmdthreads.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/recordmydesktop/src/rmdthreads.c b/recordmydesktop/src/rmdthreads.c
index 4199472..014a1d6 100644
--- a/recordmydesktop/src/rmdthreads.c
+++ b/recordmydesktop/src/rmdthreads.c
@@ -65,10 +65,11 @@ void rmdThreads(ProgData *pdata){
(void *)pdata);
if(!pdata->args.nosound){
- pthread_create(&sound_capture_t,
- NULL,
- (void *)CaptureSound,
- (void *)pdata);
+ if(!pdata->args.use_jack)
+ pthread_create(&sound_capture_t,
+ NULL,
+ (void *)CaptureSound,
+ (void *)pdata);
if(pdata->args.encOnTheFly)
pthread_create(&sound_encode_t,
NULL,
@@ -88,7 +89,11 @@ void rmdThreads(ProgData *pdata){
RegisterCallbacks(&pdata->args);
fprintf(stderr,"Capturing!\n");
-
+#ifdef HAVE_JACK_H
+ if(pdata->args.use_jack){
+ pdata->jdata->capture_started=1;
+ }
+#endif
//wait all threads to finish
pthread_join(image_capture_t,NULL);
@@ -108,9 +113,14 @@ void rmdThreads(ProgData *pdata){
pthread_join(image_cache_t,NULL);
fprintf(stderr,".");
if(!pdata->args.nosound){
- pthread_join(sound_capture_t,NULL);
+#ifdef HAVE_JACK_H
+ if(pdata->args.use_jack)
+ StopJackClient(pdata->jdata);
+#endif
+ if(!pdata->args.use_jack)
+ pthread_join(sound_capture_t,NULL);
fprintf(stderr,".");
- while(!pdata->v_enc_thread_waiting && !pdata->v_encoding_clean){
+ while(pdata->v_enc_thread_waiting || !pdata->v_encoding_clean){
usleep(10000);
pthread_mutex_lock(&pdata->snd_buff_ready_mutex);
pthread_cond_signal(&pdata->sound_data_read);
© All Rights Reserved