changeset 11846:e3c3d01e9b86

Pass header to codec in extradata (needed by ffmpeg fli decoder)
author rtognimp
date Sun, 25 Jan 2004 17:36:30 +0000
parents c047ebdb0461
children f5effe037458
files libmpdemux/demux_fli.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_fli.c	Sun Jan 25 16:17:38 2004 +0000
+++ b/libmpdemux/demux_fli.c	Sun Jan 25 17:36:30 2004 +0000
@@ -74,10 +74,16 @@
   int speed;
   unsigned int frame_size;
   int magic_number;
+  unsigned char * header;
 
   // go back to the beginning
   stream_reset(demuxer->stream);
   stream_seek(demuxer->stream, 0);
+
+  header = malloc(sizeof(BITMAPINFOHEADER) + 128);
+  stream_read(demuxer->stream, header + sizeof(BITMAPINFOHEADER), 128);
+  stream_seek(demuxer->stream, 0);
+
   demuxer->movi_start = 128;
   demuxer->movi_end = stream_read_dword_le(demuxer->stream);
 
@@ -116,6 +122,10 @@
   sh_video->disp_w = stream_read_word_le(demuxer->stream);
   sh_video->disp_h = stream_read_word_le(demuxer->stream);
 
+  // pass extradata to codec
+  sh_video->bih = (BITMAPINFOHEADER*)header;
+  sh_video->bih->biSize = sizeof(BITMAPINFOHEADER) + 128;
+    
   // skip the video depth and flags
   stream_skip(demuxer->stream, 4);