The one-line fix below fixes a problem where aviio.c writes out ridiculously large lengths for the audio stream of an AVI file. The occurrence of the bug depends on the way that audio buffers are filled by the calling code; if there are never two or more chunk's worth of audio samples queued then the bug will not occur. However, CD-i Emulator queues much more and this triggers the bug. Some more info can be found on the CD-i Bits blog: http://cdibits.blogspot.com/2009/11/iff-reading-and-avi-writing-bugfix.html --- orig\aviio.c 2009-10-20 00:35:53.000000000 +0200 +++ aviio.c 2009-11-23 23:20:21.000000000 +0100 @@ -2307,7 +2358,7 @@ /* add up the samples */ if (channelsamples > 0) - file->info.audio_numsamples = stream->samples += channelsamples; + file->info.audio_numsamples = stream->samples += chunksamples; /* advance past those */ processedsamples += chunksamples;