From: Daniel M. <zo...@us...> - 2004-06-12 19:03:08
|
Update of /cvsroot/xine/xine-lib/src/audio_out In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23855 Modified Files: audio_coreaudio_out.c Log Message: Try to get smaller A/V delay Index: audio_coreaudio_out.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/audio_out/audio_coreaudio_out.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- audio_coreaudio_out.c 10 Jun 2004 18:33:31 -0000 1.1 +++ audio_coreaudio_out.c 12 Jun 2004 19:03:00 -0000 1.2 @@ -78,7 +78,8 @@ uint8_t buf[BUFSIZE]; uint32_t buf_readpos; uint32_t buf_writepos; - + uint32_t last_block_size; + pthread_mutex_t mutex; } coreaudio_driver_t; @@ -119,6 +120,8 @@ this->buf_readpos += ioData->mBuffers[i].mDataByteSize; } + this->last_block_size = req_size; + pthread_mutex_unlock (&this->mutex); return noErr; @@ -144,6 +147,7 @@ this->bytes_per_frame = 4; this->buf_readpos = 0; this->buf_writepos = 0; + this->last_block_size = 0; pthread_mutex_init (&this->mutex, NULL); xprintf (this->xine, XINE_VERBOSITY_DEBUG, @@ -294,7 +298,8 @@ static int ao_coreaudio_delay (ao_driver_t *this_gen) { coreaudio_driver_t *this = (coreaudio_driver_t *) this_gen; - return (this->buf_writepos - this->buf_readpos) / this->bytes_per_frame; + return (this->buf_writepos - this->buf_readpos + this->last_block_size) + / this->bytes_per_frame; } static void ao_coreaudio_close(ao_driver_t *this_gen) |