changeset 1742:0880718750d5

fix signalhandling
author pontscho
date Wed, 29 Aug 2001 13:52:08 +0000
parents b60319205152
children b266f763cad3
files Gui/mplayer/mplayer.c Gui/mplayer/widgets.c
diffstat 2 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/mplayer.c	Wed Aug 29 13:44:12 2001 +0000
+++ b/Gui/mplayer/mplayer.c	Wed Aug 29 13:52:08 2001 +0000
@@ -53,7 +53,7 @@
 // parse_cfgfiles( argc,argv,envp );
 
  // allocates shmem to gtkShMem
- // fork() a process which runs gtkThreadProc()  [gtkChildPID]
+ // fork() a process which runs gtkThreadProc()  [gtkPID]
  gtkInit( argc,argv,envp );
 
  // allocates shmem to mplShMem
@@ -76,6 +76,7 @@
   wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsShowWindow,"ViDEO" );
 
  vo_setwindow(appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC);
+ vo_setwindowsize( appMPlayer.sub.width,appMPlayer.sub.height );
  mplSubRender=0;
  
  wsCreateWindow( &appMPlayer.mainWindow,
--- a/Gui/mplayer/widgets.c	Wed Aug 29 13:44:12 2001 +0000
+++ b/Gui/mplayer/widgets.c	Wed Aug 29 13:52:08 2001 +0000
@@ -59,8 +59,6 @@
  Options=create_Options();
 }
 
-int             gtkParent = 1;
-
 // --- forked function
 
 static void gtkThreadProc( int argc,char * argv[] )
@@ -71,9 +69,7 @@
 
  widgetsCreate();
 
-// gtkParentPID=getppid();
-// gtkChildPID=getpid();
- gtkParent=0;
+ gtkPID=getppid();
 
  signal( SIGTYPE,gtkSigHandler );
 
@@ -89,9 +85,8 @@
 
 void gtkInit( int argc,char* argv[], char *envp[] )
 {
- gtkParentPID=getpid();
  gtkShMem=shmem_alloc( ShMemSize );
- if ( ( gtkChildPID = fork() ) == 0 ) gtkThreadProc( argc,argv );
+ if ( ( gtkPID = fork() ) == 0 ) gtkThreadProc( argc,argv );
 }
 
 void gtkDone( void ){
@@ -99,7 +94,7 @@
  gtkSendMessage(evExit);
  usleep(50000); // 50ms should be enough!
  printf("gtk killed...\n");
- kill( gtkChildPID,SIGKILL );
+ kill( gtkPID,SIGKILL );
 }
 
 void gtkMessageBox( gchar * str )