changeset 24697:8f2154e066cf

Make sure forked code does not try to display a GTK message box (and thus crashes)
author reimar
date Sun, 07 Oct 2007 08:41:31 +0000
parents 31b061728922
children 6f56399be56c
files mp_msg.c stream/cache2.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mp_msg.c	Sun Oct 07 08:19:11 2007 +0000
+++ b/mp_msg.c	Sun Oct 07 08:41:31 2007 +0000
@@ -16,6 +16,7 @@
 
 #if defined(FOR_MENCODER)
 #undef HAVE_NEW_GUI
+int use_gui;
 #endif
 
 #ifdef HAVE_NEW_GUI
--- a/stream/cache2.c	Sun Oct 07 08:19:11 2007 +0000
+++ b/stream/cache2.c	Sun Oct 07 08:41:31 2007 +0000
@@ -29,6 +29,7 @@
 
 #include "stream.h"
 #include "input/input.h"
+extern int use_gui;
 
 int stream_fill_buffer(stream_t *s);
 int stream_seek_long(stream_t *s,off_t pos);
@@ -305,6 +306,9 @@
 static DWORD WINAPI ThreadProc(void*s){
 #endif
   
+#ifdef HAVE_NEW_GUI
+  use_gui = 0; // mp_msg may not use gui stuff in forked code
+#endif
 // cache thread mainloop:
   signal(SIGTERM,exit_sighandler); // kill
   while(1){