magic_number checking added

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3230 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2001-11-30 20:50:08 +00:00
parent 64fc8aac35
commit eafcb53338
1 changed files with 15 additions and 0 deletions

View File

@ -65,8 +65,19 @@ demuxer_t* demux_open_fli(demuxer_t* demuxer){
demuxer->movi_start = 128;
demuxer->movi_end = stream_read_dword_le(demuxer->stream);
#if 0
// skip the magic number
stream_skip(demuxer->stream, 2);
#else
magic_number = stream_read_word_le(demuxer->stream);
if ((magic_number != 0xAF11) && (magic_number != 0xAF12))
{
mp_msg(MSGT_DEMUX, MSGL_ERR, "Bad/unknown magic number (%04x)\n",
magic_number);
return(NULL);
}
#endif
// fetch the number of frames
frames->num_frames = stream_read_word_le(demuxer->stream);
@ -101,6 +112,10 @@ demuxer_t* demux_open_fli(demuxer_t* demuxer){
speed = stream_read_word_le(demuxer->stream);
if (speed == 0)
speed = 1;
#if 0
if (magic_number == 0xAF11)
speed *= 1000/70;
#endif
sh_video->fps = 1000 / speed;
sh_video->frametime = 1/sh_video->fps;