Fixed bug: Core dumped if SoundFildes==-1.

This commit is contained in:
johns 2001-03-08 10:10:43 +00:00
parent 1b971338e2
commit ada35fd2a0
3 changed files with 10 additions and 10 deletions

View file

@ -798,7 +798,7 @@ global void WaitEventsAndKeepSync(void)
//
// Sound
//
if( !SoundOff && !SoundThreadRunning ) {
if( !SoundOff && !SoundThreadRunning && SoundFildes!=-1 ) {
if( SoundFildes>maxfd ) {
maxfd=SoundFildes;
}
@ -852,8 +852,8 @@ global void WaitEventsAndKeepSync(void)
//
// Sound
//
if( !SoundOff && !SoundThreadRunning
&& FD_ISSET(SoundFildes,&wfds) ) {
if( !SoundOff && !SoundThreadRunning && SoundFildes!=-1
&& FD_ISSET(SoundFildes,&wfds) ) {
WriteSound();
}

View file

@ -220,7 +220,7 @@ global void InitVideoSdl(void)
#endif
#endif
DebugLevel0Fn("Video init ready %d %d\n",VideoDepth,VideoBpp);
DebugLevel3Fn("Video init ready %d %d\n",VideoDepth,VideoBpp);
}
/**
@ -569,11 +569,11 @@ global void WaitEventsAndKeepSync(void)
}
}
#ifndef USE_WIN32
#ifndef USE_SDLA
//
// Sound
//
if( !SoundOff && !SoundThreadRunning ) {
if( !SoundOff && !SoundThreadRunning && SoundFildes!=-1 ) {
if( SoundFildes>maxfd ) {
maxfd=SoundFildes;
}
@ -596,11 +596,11 @@ global void WaitEventsAndKeepSync(void)
}
if( maxfd>0 ) {
#ifndef USE_WIN32
#ifndef USE_SDLA
//
// Sound
//
if( !SoundOff && !SoundThreadRunning
if( !SoundOff && !SoundThreadRunning && SoundFildes!=-1
&& FD_ISSET(SoundFildes,&wfds) ) {
WriteSound();
}

View file

@ -975,7 +975,7 @@ global void WaitEventsAndKeepSync(void)
//
// Sound
//
if(!SoundOff && !SoundThreadRunning) {
if( !SoundOff && !SoundThreadRunning && SoundFildes!=-1 ) {
FD_SET(SoundFildes, &wfds);
}
@ -985,7 +985,7 @@ global void WaitEventsAndKeepSync(void)
//
// Sound
//
if(!SoundOff && !SoundThreadRunning
if(!SoundOff && !SoundThreadRunning && SoundFildes!=-1
&& FD_ISSET(SoundFildes, &wfds)) {
WriteSound();
}