From b23f7d232b98527846bfcd41aed36914ffbc431b Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Fri, 14 Mar 2008 20:13:48 +0000 Subject: xine_init(): mutex objs not initialized The problem comes from the fact that into xine_probe_fast_memcpy() there is a call to xprintf, which excutes some actions to this->log_lock. But the "log_lock" field is still uninitialized. Under Windows, the xine_init() always crashes because that type is implemented as a structure, so the lock receives a NULL pointer and the execution is halted. The attached patch proposes to move the mutex objects to the top of xine_init() function. --HG-- extra : transplant_source : %07%1D%7F%F0%97%7D%06%3E%9F%2Ar%03%1DQ%14%F3%D1%EF%1D%93 --- src/xine-engine/xine.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index efb845be5..d58b4ea55 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -1662,6 +1662,12 @@ void xine_init (xine_t *this) { static const char *demux_strategies[] = {"default", "reverse", "content", "extension", NULL}; + /* + * locks + */ + pthread_mutex_init (&this->streams_lock, NULL); + pthread_mutex_init (&this->log_lock, NULL); + /* initialize color conversion tables and functions */ init_yuv_conversion(); @@ -1742,12 +1748,6 @@ void xine_init (xine_t *this) { */ this->streams = xine_list_new(); - /* - * locks - */ - pthread_mutex_init (&this->streams_lock, NULL); - pthread_mutex_init (&this->log_lock, NULL); - /* * start metronom clock */ -- cgit v1.2.3