From: James Courtier-D. <Ja...@su...> - 2003-09-04 14:14:15
|
Miguel Freitas wrote: > Update of /cvsroot/xine/xine-lib/src/xine-engine > In directory sc8-pr-cvs1:/tmp/cvs-serv8948 > > Modified Files: > audio_out.c > Log Message: > still fighting the same bug. now i must have killed it :) > (unfortunately it takes hours of testing to reproduce...) > > > Index: audio_out.c > =================================================================== > RCS file: /cvsroot/xine/xine-lib/src/xine-engine/audio_out.c,v > retrieving revision 1.143 > retrieving revision 1.144 > diff -u -r1.143 -r1.144 > --- audio_out.c 4 Sep 2003 00:21:09 -0000 1.143 > +++ audio_out.c 4 Sep 2003 13:56:23 -0000 1.144 > @@ -1681,6 +1681,9 @@ > > /* do not try this in paused mode */ > while( this->flush_audio_driver ) { > + struct timeval tv; > + struct timespec ts; > + > /* release mutex to get a buffer, otherwise a deadlock may happen */ > pthread_mutex_unlock(&this->flush_audio_driver_lock); > buf = fifo_remove (this->free_fifo); > @@ -1689,7 +1692,15 @@ > buf->num_frames = 0; > buf->stream = NULL; > fifo_append (this->out_fifo, buf); > - pthread_cond_wait(&this->flush_audio_driver_reached, &this->flush_audio_driver_lock); > + > + /* cond_timedwait was not supposed be needed here, but somehow it may still > + * get stuck when using normal cond_wait. probably the signal is missed when > + * we release the mutex above. > + */ > + gettimeofday(&tv, NULL); > + ts.tv_sec = tv.tv_sec + 1; > + ts.tv_nsec = tv.tv_usec * 1000; > + pthread_cond_timedwait(&this->flush_audio_driver_reached, &this->flush_audio_driver_lock, &ts); > } > this->discard_buffers--; > > Would you be able to explain the problem you are tinkering with? We might be able to help. Cheers James |