summaryrefslogtreecommitdiff
path: root/src/xine-engine/video_out.c
diff options
context:
space:
mode:
authorJuergen Keil <jkeil@users.sourceforge.net>2001-10-03 17:15:43 +0000
committerJuergen Keil <jkeil@users.sourceforge.net>2001-10-03 17:15:43 +0000
commit70564011218ab5eef38842412af9313b2a133f69 (patch)
treedda4a4296e74ddb4c07c14aa7eea471eef9bbe15 /src/xine-engine/video_out.c
parent2341ac8aa13c8ad994eab1fbbefe98238ed4f117 (diff)
downloadxine-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/video_out.c')
-rw-r--r--src/xine-engine/video_out.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 97b228327..142488a48 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.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: video_out.c,v 1.49 2001/10/03 14:11:54 miguelfreitas Exp $
+ * $Id: video_out.c,v 1.50 2001/10/03 17:15:44 jkeil Exp $
*
*/
@@ -337,6 +337,7 @@ static uint32_t vo_get_capabilities (vo_instance_t *this) {
static void vo_open (vo_instance_t *this) {
pthread_attr_t pth_attrs;
+ int err;
if (!this->video_loop_running) {
this->video_loop_running = 1;
@@ -344,11 +345,12 @@ static void vo_open (vo_instance_t *this) {
pthread_attr_init(&pth_attrs);
pthread_attr_setscope(&pth_attrs, PTHREAD_SCOPE_SYSTEM);
- if( pthread_create (&this->video_thread, &pth_attrs, video_out_loop, this) )
+ if((err = pthread_create (&this->video_thread,
+ &pth_attrs, video_out_loop, this)) != 0)
{
- printf ("video_out: error creating thread\n");
+ fprintf (stderr, "video_out: can't create thread (%s)\n", strerror(err));
/* FIXME: why pthread_create fails? */
- printf ("Sorry, this should not happen. Please restart Xine.\n");
+ fprintf (stderr, "Sorry, this should not happen. Please restart Xine.\n");
exit(1);
}
else