From: Hans-Dieter K. <fs...@us...> - 2007-07-14 02:29:59
|
Update of /cvsroot/xine/xine-ui/src/xitk In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24144 Modified Files: actions.c Log Message: Patch from Stas Sergeev: Fixed a race condition that caused playing an MRL erroneously in logo mode. Index: actions.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/actions.c,v retrieving revision 1.276 retrieving revision 1.277 diff -u -r1.276 -r1.277 --- actions.c 13 Jul 2007 23:56:04 -0000 1.276 +++ actions.c 14 Jul 2007 02:29:57 -0000 1.277 @@ -48,6 +48,10 @@ static pthread_mutex_t new_pos_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t logo_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; +/* Note: We need error check lock for the logo_mutex as it may be locked */ +/* twice by the same thread; fast lock would cause a dead lock! */ + static int last_playback_speed = XINE_SPEED_NORMAL; void reparent_all_windows(void) { @@ -203,6 +207,8 @@ * */ void gui_display_logo(void) { + + pthread_mutex_lock(&logo_mutex); gGui->logo_mode = 2; @@ -228,6 +234,7 @@ if(stream_infos_is_visible()) stream_infos_update_infos(); + pthread_mutex_unlock(&logo_mutex); } static int _gui_xine_play(xine_stream_t *stream, @@ -266,8 +273,10 @@ else { char *ident; + pthread_mutex_lock(&logo_mutex); if(gGui->logo_mode != 2) gGui->logo_mode = 0; + pthread_mutex_unlock(&logo_mutex); if(gGui->logo_mode == 0) { |