$OpenBSD: patch-src_xitk_actions_c,v 1.1 2013/04/29 02:36:23 brad Exp $

- Fix shutdown race.
- Open user file immediately when only logo is playing.

--- src/xitk/actions.c.orig	Sat Apr 27 19:34:24 2013
+++ src/xitk/actions.c	Sat Apr 27 19:41:35 2013
@@ -667,6 +667,9 @@ void gui_exit (xitk_widget_t *w, void *data) {
     }
     
     xine_stop (gGui->stream);
+    while(xine_get_status(gGui->stream) == XINE_STATUS_PLAY)
+      xine_usec_sleep(50000);
+
     gGui->ignore_next = 0;
   }
   
@@ -2145,7 +2148,8 @@ static void fileselector_callback(filebrowser_t *fb) {
 
     /* If an MRL is not being played, select the first file appended. If in "smart mode" start
        playing the entry.  If a an MRL is currently being played, let it continue normally */
-    if((first != gGui->playlist.num) && (xine_get_status(gGui->stream) == XINE_STATUS_STOP)) {
+    if((first != gGui->playlist.num) &&
+      (gGui->logo_mode || (xine_get_status(gGui->stream) == XINE_STATUS_STOP))) {
       gGui->playlist.cur = first;
       if(gGui->smart_mode) {
         gui_set_current_mmk(mediamark_get_current_mmk());
