From: <as...@on...> - 2005-10-18 20:52:12
|
Ported motion 3.2.4 snap3 to windows with MinGW Trying to read from my Axis netcamera, but when first image are read it crash! Threre is an obvious bug in netcam.c (also in daily snapshot 18.10.2005) The "pthread_mutex_init(&netcam->mutex, NULL)" is initialised too late! It's used in "netcam->get_image(netcam)" It's works in linux but for Windows it will crash. Code: static int netcam_read_html_jpeg(netcam_context_ptr netcam) { .... /// Eeeekk! Uninitialised!!! Crash on windows! pthread_mutex_lock(&netcam->mutex); ... } int netcam_start(struct context *cnt) { .... // calling netcam_read_html_jpeg()! if ((retval = netcam->get_image(netcam)) != 0) { motion_log(LOG_ERR, 0, "Failed trying to read first image"); return -1; } ..... /* * Everything is now ready - start up the * "handler thread". */ // too late ! pthread_mutex_init(&netcam->mutex, NULL); .. } Rgds Asbjorn Pettersen |