summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recordmydesktop/src/capture_sound.c4
-rw-r--r--recordmydesktop/src/recordmydesktop.c14
2 files changed, 13 insertions, 5 deletions
diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c
index f28ba26..3bda596 100644
--- a/recordmydesktop/src/capture_sound.c
+++ b/recordmydesktop/src/capture_sound.c
@@ -57,7 +57,9 @@ void *CaptureSound(void *pdata){
NULL//let's hope that the device capabilities didn't magically change
);
if(((ProgData *)pdata)->sound_handle==NULL){
- fprintf(stderr,"Couldn't reopen sound device.\nThere will be no sound data from this point on.\n");
+ fprintf(stderr,"Couldn't reopen sound device.Exiting\n");
+ ((ProgData *)pdata)->running=0;
+ errno=3;
pthread_exit(&errno);
}
}
diff --git a/recordmydesktop/src/recordmydesktop.c b/recordmydesktop/src/recordmydesktop.c
index 5b7e32b..6b9e003 100644
--- a/recordmydesktop/src/recordmydesktop.c
+++ b/recordmydesktop/src/recordmydesktop.c
@@ -30,7 +30,7 @@
int main(int argc,char **argv){
ProgData pdata;
-
+ int exit_status=0;
if(XInitThreads ()==0){
fprintf(stderr,"Couldn't initialize thread support!\n");
exit(7);
@@ -207,9 +207,15 @@ int main(int argc,char **argv){
pthread_join(image_encode_t,NULL);
fprintf(stderr,".");
if(!pdata.args.nosound){
- pthread_join(sound_capture_t,NULL);
+ int *snd_exit;
+ pthread_join(sound_capture_t,(&snd_exit));
fprintf(stderr,".");
- pthread_join(sound_encode_t,NULL);
+ if(!(*snd_exit))
+ pthread_join(sound_encode_t,NULL);
+ else{
+ pthread_cancel(sound_encode_t);
+ exit_status=*snd_exit;
+ }
fprintf(stderr,".");
}
else
@@ -240,7 +246,7 @@ int main(int argc,char **argv){
else
fprintf(stderr,"Goodbye!\n");
}
- return 0;
+ return exit_status;
}
© All Rights Reserved