fix movie texture crash on signal (eg. suspend)

This commit is contained in:
Glenn Maynard
2004-03-26 05:47:56 +00:00
parent c51170c7b7
commit 76c6ab7af5
@@ -839,12 +839,19 @@ void MovieTexture_FFMpeg::DecoderThread()
/* Signal the main thread to update the image on the next Update. */
m_ImageWaiting=true;
CHECKPOINT;
SDL_SemWait( m_BufferFinished );
CHECKPOINT;
/* SDL_SemWait does not properly retry sem_wait in Linux on EINTR. */
do
{
CHECKPOINT;
errno = 0;
ret = SDL_SemWait( m_BufferFinished );
}
while( ret == -1 && errno == EINTR );
ASSERT_M( ret != -1, ssprintf("%s, %s", SDL_GetError(), strerror(errno)) );
/* If the frame wasn't used, then we must be shutting down. */
ASSERT( !m_ImageWaiting || m_State == DECODER_QUIT );
ASSERT( !m_ImageWaiting || m_State == DECODER_QUIT, ssprintf("%i", m_State) );
}
CHECKPOINT;
}