[FFmpeg-devel] [PATCH] FLIC demuxer fix for the first two X-COM games (also adds audio)

Michael Niedermayer michaelni
Tue Mar 16 02:09:44 CET 2010


On Fri, Feb 26, 2010 at 10:05:00AM +0100, Tomas H?rdin wrote:
> Good morning
> 
> Last christmas I reverse-engineered the video format used in the first
> two X-COM games ("UFO: Enemy Unknown" and "X-COM: Terror from the
> Deep"). It turned out to simply be normal FLIC files with extra audio
> chunks. This patch detects the presence of such a chunk at the start of
> the file, and adds a 22050 Hz mono 8-bit audio stream in that case. It
> also calculates the proper framerate, since these videos appear to have
> been created in a two-step process (audio added later, thus altering the
> frame rate).
> 
> In order to detect these videos I had to peek at the first preamble in
> the file, which means reading and rewinding six bytes. This should
> hopefully not be a problem since I'm fairly sure ByteIOContext has a
> small buffer for these sort of things. A similar trick is used in the
> Magic Carpet case, so I've figured it's OK anyway.
> 
> Regarding audio, the code assumes all audio chunks contain the same
> number of samples and sets block_align accordingly. One final thing is
> that these audio chunks have an extra 10 B header not accounted for in
> the chunk header, which caused the old demuxer to "derail".
> 
> I ran the regression test for good measure. They still pass. Samples
> uploaded to incoming/xcom/ (*.VID). Works for all five videos in the
> second game, but I haven't been able to test it on those in the first
> game.
> 
> /Tomas

>  flic.c |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 66 insertions(+), 6 deletions(-)
> b303ed0974425f738f96476229cd75b8c01817a3  xcom.patch

looks ok, probably mike will want to add a test to fate
and maybe flic needs a second maintainer

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100316/cef9ce06/attachment.pgp>



More information about the ffmpeg-devel mailing list