# HG changeset patch # User melanson # Date 1006652935 0 # Node ID f951f3be126c51ce9dd2b446a5e41170a411df87 # Parent 829637d529e92c8d0485fbde2aea3b2949ccae1b fixed FLI demuxer so that it skips over app-specific frames diff -r 829637d529e9 -r f951f3be126c libmpdemux/demux_fli.c --- a/libmpdemux/demux_fli.c Sun Nov 25 00:56:41 2001 +0000 +++ b/libmpdemux/demux_fli.c Sun Nov 25 01:48:55 2001 +0000 @@ -55,6 +55,8 @@ fli_frames_t *frames = (fli_frames_t *)malloc(sizeof(fli_frames_t)); int frame_number; int speed; + unsigned int frame_size; + int magic_number; // go back to the beginning stream_reset(demuxer->stream); @@ -107,11 +109,21 @@ while ((!stream_eof(demuxer->stream)) && (frame_number < frames->num_frames)) { frames->filepos[frame_number] = stream_tell(demuxer->stream); - frames->frame_size[frame_number] = stream_read_dword_le(demuxer->stream); - stream_skip(demuxer->stream, frames->frame_size[frame_number] - 4); - frame_number++; + frame_size = stream_read_dword_le(demuxer->stream); + magic_number = stream_read_word_le(demuxer->stream); + stream_skip(demuxer->stream, frame_size - 6); + + // if this chunk has the right magic number, index it + if (magic_number == 0xF1FA) + { + frames->frame_size[frame_number] = frame_size; + frame_number++; + } } + // save the actual number of frames indexed + frames->num_frames = frame_number; + demuxer->priv = frames; return demuxer;