summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-13 13:28:47 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-13 13:28:47 +0000
commit8a725405c8014235bf2b5b5010bfcb1003d324aa (patch)
tree14c6103b486fe2321288fc5b489c489b6605918b /recordmydesktop/src
parent17a82a0343b90ed80da99ca838e5cd2cdcaf93e2 (diff)
include/rmdtypes.h
include/recordmydesktop.h: Continue the globals killing spree by putting pause_mutex and time_mutex in ProgData instead of having them as globals. src/get_frame.c src/rmd_timer.c src/cache_audio.c src/cache_frame.c src/capture_sound.c src/initialize_data.c src/encode_image_buffer.c src/encode_sound_buffer.c: Adapt. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@532 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/cache_audio.c6
-rw-r--r--recordmydesktop/src/cache_frame.c6
-rw-r--r--recordmydesktop/src/capture_sound.c18
-rw-r--r--recordmydesktop/src/encode_image_buffer.c6
-rw-r--r--recordmydesktop/src/encode_sound_buffer.c6
-rw-r--r--recordmydesktop/src/get_frame.c6
-rw-r--r--recordmydesktop/src/initialize_data.c4
-rw-r--r--recordmydesktop/src/rmd_timer.c8
8 files changed, 30 insertions, 30 deletions
diff --git a/recordmydesktop/src/cache_audio.c b/recordmydesktop/src/cache_audio.c
index ac21615..27a8141 100644
--- a/recordmydesktop/src/cache_audio.c
+++ b/recordmydesktop/src/cache_audio.c
@@ -43,9 +43,9 @@ void *CacheSoundBuffer(ProgData *pdata){
SndBuffer *buff=NULL;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
if(!pdata->args.use_jack){
if(pdata->sound_buffer==NULL){
diff --git a/recordmydesktop/src/cache_frame.c b/recordmydesktop/src/cache_frame.c
index 79e955f..faf2394 100644
--- a/recordmydesktop/src/cache_frame.c
+++ b/recordmydesktop/src/cache_frame.c
@@ -116,9 +116,9 @@ void *CacheImageBuffer(ProgData *pdata){
pdata->th_enc_thread_waiting=0;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
pthread_mutex_lock(&pdata->yuv_mutex);
diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c
index 71424f9..d32715e 100644
--- a/recordmydesktop/src/capture_sound.c
+++ b/recordmydesktop/src/capture_sound.c
@@ -43,16 +43,16 @@ void *CaptureSound(ProgData *pdata){
#ifdef HAVE_LIBASOUND
if(!pdata->hard_pause){
snd_pcm_pause(pdata->sound_handle,1);
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
snd_pcm_pause(pdata->sound_handle,0);
}
else{//device doesn't support pause(is this the norm?mine doesn't)
snd_pcm_close(pdata->sound_handle);
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
pdata->sound_handle=
OpenDev(pdata->args.device,
&pdata->args.channels,
@@ -72,9 +72,9 @@ void *CaptureSound(ProgData *pdata){
}
#else
close(pdata->sound_handle);
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
pdata->sound_handle=
OpenDev(pdata->args.device,
pdata->args.channels,
diff --git a/recordmydesktop/src/encode_image_buffer.c b/recordmydesktop/src/encode_image_buffer.c
index 94cd5d2..1242071 100644
--- a/recordmydesktop/src/encode_image_buffer.c
+++ b/recordmydesktop/src/encode_image_buffer.c
@@ -39,9 +39,9 @@ void *EncodeImageBuffer(ProgData *pdata){
pdata->th_enc_thread_waiting=0;
encoder_busy=1;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
pthread_mutex_lock(&pdata->yuv_mutex);
diff --git a/recordmydesktop/src/encode_sound_buffer.c b/recordmydesktop/src/encode_sound_buffer.c
index 47b8211..919b649 100644
--- a/recordmydesktop/src/encode_sound_buffer.c
+++ b/recordmydesktop/src/encode_sound_buffer.c
@@ -43,9 +43,9 @@ void *EncodeSoundBuffer(ProgData *pdata){
SndBuffer *buff=NULL;
if (pdata->paused) {
- pthread_mutex_lock(&pause_mutex);
- pthread_cond_wait(&pdata->pause_cond,&pause_mutex);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
+ pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
if(!pdata->args.use_jack){
if(pdata->sound_buffer==NULL){
diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c
index d4dee67..1a5d445 100644
--- a/recordmydesktop/src/get_frame.c
+++ b/recordmydesktop/src/get_frame.c
@@ -390,9 +390,9 @@ void *GetFrame(ProgData *pdata){
//also before actually pausing we must make sure the streams
//are synced. sound stops so this should only happen quickly.
if(pdata->avd>0 || pdata->args.nosound){
- pthread_mutex_lock(&time_mutex);
- pthread_cond_wait(&pdata->time_cond,&time_mutex);
- pthread_mutex_unlock(&time_mutex);
+ pthread_mutex_lock(&pdata->time_mutex);
+ pthread_cond_wait(&pdata->time_cond, &pdata->time_mutex);
+ pthread_mutex_unlock(&pdata->time_mutex);
if (pdata->paused) {
//this is necessary since event loop processes
//the shortcuts which will unpause the program
diff --git a/recordmydesktop/src/initialize_data.c b/recordmydesktop/src/initialize_data.c
index 56e3beb..1e206ae 100644
--- a/recordmydesktop/src/initialize_data.c
+++ b/recordmydesktop/src/initialize_data.c
@@ -97,8 +97,8 @@ int InitializeData(ProgData *pdata,
pthread_mutex_init(&pdata->vorbis_lib_mutex,NULL);
pthread_mutex_init(&pdata->libogg_mutex,NULL);
pthread_mutex_init(&pdata->yuv_mutex,NULL);
- pthread_mutex_init(&pause_mutex,NULL);
- pthread_mutex_init(&time_mutex,NULL);
+ pthread_mutex_init(&pdata->pause_mutex, NULL);
+ pthread_mutex_init(&pdata->time_mutex, NULL);
pthread_cond_init(&pdata->time_cond,NULL);
pthread_cond_init(&pdata->pause_cond,NULL);
pthread_cond_init(&pdata->image_buffer_ready,NULL);
diff --git a/recordmydesktop/src/rmd_timer.c b/recordmydesktop/src/rmd_timer.c
index 0f8a032..28929ab 100644
--- a/recordmydesktop/src/rmd_timer.c
+++ b/recordmydesktop/src/rmd_timer.c
@@ -53,9 +53,9 @@ void *rmdTimer(ProgData *pdata){
else{
pdata->paused = FALSE;
fprintf(stderr,"STATE:RECORDING\n");fflush(stderr);
- pthread_mutex_lock(&pause_mutex);
+ pthread_mutex_lock(&pdata->pause_mutex);
pthread_cond_broadcast(&pdata->pause_cond);
- pthread_mutex_unlock(&pause_mutex);
+ pthread_mutex_unlock(&pdata->pause_mutex);
}
}
@@ -67,9 +67,9 @@ void *rmdTimer(ProgData *pdata){
}
}
- pthread_mutex_lock(&time_mutex);
+ pthread_mutex_lock(&pdata->time_mutex);
pthread_cond_broadcast(&pdata->time_cond);
- pthread_mutex_unlock(&time_mutex);
+ pthread_mutex_unlock(&pdata->time_mutex);
if(secs_tw)
© All Rights Reserved