changeset 2635:9513cc77beb0 libavformat

add support for big_endian encoded headers
author aurel
date Thu, 18 Oct 2007 22:39:27 +0000
parents 95cfd6b8f8d5
children 3b95556c8cd4
files electronicarts.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/electronicarts.c	Thu Oct 18 22:32:26 2007 +0000
+++ b/electronicarts.c	Thu Oct 18 22:39:27 2007 +0000
@@ -40,6 +40,8 @@
 #define EA_PREAMBLE_SIZE 8
 
 typedef struct EaDemuxContext {
+    int big_endian;
+
     int video_codec;
     AVRational time_base;
     int video_stream_index;
@@ -170,6 +172,10 @@
 
         blockid = get_le32(pb);
         size = get_le32(pb);
+        if (i == 0)
+            ea->big_endian = size > 0x000FFFFF;
+        if (ea->big_endian)
+            size = bswap_32(size);
 
         switch (blockid) {
             case SCHl_TAG :