mirror of
https://github.com/mpv-player/mpv
synced 2025-01-04 14:12:10 +00:00
fix signalhandling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1743 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c9da64ae3e
commit
19c99b1f13
@ -53,7 +53,7 @@ void mplInit( int argc,char* argv[], char *envp[], void* disp )
|
||||
// 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 @@ void mplInit( int argc,char* argv[], char *envp[], void* disp )
|
||||
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,
|
||||
|
@ -59,8 +59,6 @@ void widgetsCreate( void )
|
||||
Options=create_Options();
|
||||
}
|
||||
|
||||
int gtkParent = 1;
|
||||
|
||||
// --- forked function
|
||||
|
||||
static void gtkThreadProc( int argc,char * argv[] )
|
||||
@ -71,9 +69,7 @@ static void gtkThreadProc( int argc,char * argv[] )
|
||||
|
||||
widgetsCreate();
|
||||
|
||||
// gtkParentPID=getppid();
|
||||
// gtkChildPID=getpid();
|
||||
gtkParent=0;
|
||||
gtkPID=getppid();
|
||||
|
||||
signal( SIGTYPE,gtkSigHandler );
|
||||
|
||||
@ -89,9 +85,8 @@ static void gtkThreadProc( int argc,char * argv[] )
|
||||
|
||||
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 @@ void gtkDone( void ){
|
||||
gtkSendMessage(evExit);
|
||||
usleep(50000); // 50ms should be enough!
|
||||
printf("gtk killed...\n");
|
||||
kill( gtkChildPID,SIGKILL );
|
||||
kill( gtkPID,SIGKILL );
|
||||
}
|
||||
|
||||
void gtkMessageBox( gchar * str )
|
||||
|
Loading…
Reference in New Issue
Block a user