[Mplayer-cvslog] CVS: main/libmpdemux demux_fli.c,1.2,1.3
Mike Melanson
melanson at mplayer.dev.hu
Sun Nov 25 02:48:57 CET 2001
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv8100/libmpdemux
Modified Files:
demux_fli.c
Log Message:
fixed FLI demuxer so that it skips over app-specific frames
Index: demux_fli.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_fli.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demux_fli.c 25 Nov 2001 00:56:41 -0000 1.2
+++ demux_fli.c 25 Nov 2001 01:48:55 -0000 1.3
@@ -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,10 +109,20 @@
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;
More information about the MPlayer-cvslog
mailing list