diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2001-10-03 17:15:43 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2001-10-03 17:15:43 +0000 |
commit | 70564011218ab5eef38842412af9313b2a133f69 (patch) | |
tree | dda4a4296e74ddb4c07c14aa7eea471eef9bbe15 /src/xine-engine/audio_decoder.c | |
parent | 2341ac8aa13c8ad994eab1fbbefe98238ed4f117 (diff) | |
download | xine-lib-70564011218ab5eef38842412af9313b2a133f69.tar.gz xine-lib-70564011218ab5eef38842412af9313b2a133f69.tar.bz2 |
Add error checks to all "pthread_create" calls, print error message and exit
xine, whenever a pthread_create fails
CVS patchset: 729
CVS date: 2001/10/03 17:15:43
Diffstat (limited to 'src/xine-engine/audio_decoder.c')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index f6995c439..0235ba7fc 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.c,v 1.42 2001/10/01 23:04:57 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.43 2001/10/03 17:15:43 jkeil Exp $ * * * functions that implement audio decoding @@ -27,6 +27,9 @@ #include "config.h" #endif +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <sched.h> #include <unistd.h> @@ -268,6 +271,7 @@ void audio_decoder_init (xine_t *this) { pthread_attr_t pth_attrs; struct sched_param pth_params; + int err; if (this->audio_out == NULL) { this->audio_finished = 1; @@ -283,7 +287,12 @@ void audio_decoder_init (xine_t *this) { pthread_attr_setschedparam(&pth_attrs, &pth_params); pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM); - pthread_create (&this->audio_thread, &pth_attrs, audio_decoder_loop, this) ; + if ((err = pthread_create (&this->audio_thread, + &pth_attrs, audio_decoder_loop, this)) != 0) { + fprintf (stderr, "audio_decoder: can't create new thread (%s)\n", + strerror(err)); + exit (1); + } } void audio_decoder_shutdown (xine_t *this) { |