From: Thibaut M. <thi...@gm...> - 2007-11-13 12:44:25
|
Hi Matthias, On Nov 9, 2007 3:19 PM, Matthias Kretz <Mat...@ur...> wrote: > On Friday 02 November 2007, Matthias Kretz wrote: > > Otherwise I'll try my luck next week. > > I tried and have it playing correctly now, but only with lot's of debug > output. If I turn the debug output off then sometimes short sounds will not > be played (smells like a race condition). > > Attached you find a not-cleaned-up patch. Please tell me if you see me doing > any stupid things there. And if you have an idea where the race could be let > me know! I've searched the origin of the strange "CHUNK_SIZE / 2" part. I've identified this commit : http://hg.debian.org/hg/xine-lib/xine-lib/?cmd=changeset;node=d08ce5755b77;style=gitweb I don't really understand why the code has changed from "CHUNK_SIZE" to "CHUNK_SIZE / 2". It was maybe an attempt to fix a very long standing bug : the last ogg page was not sent to the decoder. Have you tried a simple fix like the following read_ogg_packet version ? static int read_ogg_packet (demux_ogg_t *this) { char *buffer; long bytes; while (ogg_sync_pageout(&this->oy,&this->og) != 1) { buffer = ogg_sync_buffer(&this->oy, CHUNKSIZE); bytes = this->input->read(this->input, buffer, CHUNKSIZE); if (bytes <= 0) return 0; ogg_sync_wrote(&this->oy, bytes); } } return 1; } regards, Thibaut |