changeset 11797:571295c177d2

Fix for Real files with header size == 0x10 (normally is 0x12) (fixes sample file header_size_10.rmvb) Patch by LR <hephooey (at) fastmail (dot) fm>
author rtognimp
date Fri, 16 Jan 2004 22:38:55 +0000
parents f4305ab15f4f
children eaf11811351c
files libmpdemux/demux_real.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_real.c	Fri Jan 16 22:27:25 2004 +0000
+++ b/libmpdemux/demux_real.c	Fri Jan 16 22:38:55 2004 +0000
@@ -870,11 +870,16 @@
     int a_streams=0;
     int v_streams=0;
     int i;
+    int header_size;
 
-    stream_skip(demuxer->stream, 4); /* header size */
-    stream_skip(demuxer->stream, 2); /* version */
-//    stream_skip(demuxer->stream, 4);
-    i = stream_read_dword(demuxer->stream);
+    header_size = stream_read_dword(demuxer->stream); /* header size */
+    mp_msg(MSGT_DEMUX,MSGL_V, "real: Header size: %d\n", header_size);
+    i = stream_read_word(demuxer->stream); /* version */
+    mp_msg(MSGT_DEMUX,MSGL_V, "real: Header object version: %d\n", i);
+    if (header_size == 0x10)
+    	i = stream_read_word(demuxer->stream);
+    else /* we should test header_size here too. */
+    	i = stream_read_dword(demuxer->stream);
     mp_msg(MSGT_DEMUX,MSGL_V, "real: File version: %d\n", i);
     num_of_headers = stream_read_dword(demuxer->stream);
 //    stream_skip(demuxer->stream, 4); /* number of headers */