# HG changeset patch # User alex # Date 1040574062 0 # Node ID 4b29a7646dacbcc74436d51c0d3baac2ac28c2c1 # Parent 8996a4599a41ced48ff750aa058bd252438c0c93 alpha support by Alan Young diff -r 8996a4599a41 -r 4b29a7646dac libmpcodecs/vd_realvid.c --- a/libmpcodecs/vd_realvid.c Sun Dec 22 14:59:41 2002 +0000 +++ b/libmpcodecs/vd_realvid.c Sun Dec 22 16:21:02 2002 +0000 @@ -22,11 +22,33 @@ LIBVD_EXTERN(realvid) -static unsigned long (*rvyuv_custom_message)(unsigned long*,void*); +/* + * Structures for data packets. These used to be tables of unsigned ints, but + * that does not work on 64 bit platforms (e.g. Alpha). The entries that are + * pointers get truncated. Pointers on 64 bit platforms are 8 byte longs. + * So we have to use structures so the compiler will assign the proper space + * for the pointer. + */ +typedef struct cmsg_data_s { + uint32_t data1; + uint32_t data2; + uint32_t* dimensions; +} cmsg_data_t; + +typedef struct transform_in_s { + uint32_t len; + uint32_t unknown1; + uint32_t chunks; + uint32_t* extra; + uint32_t unknown2; + uint32_t timestamp; +} transform_in_t; + +static unsigned long (*rvyuv_custom_message)(cmsg_data_t* ,void*); static unsigned long (*rvyuv_free)(void*); static unsigned long (*rvyuv_hive_message)(unsigned long,unsigned long); static unsigned long (*rvyuv_init)(void*, void*); // initdata,context -static unsigned long (*rvyuv_transform)(char*, char*,unsigned long*,unsigned long*,void*); +static unsigned long (*rvyuv_transform)(char*, char*,transform_in_t*,unsigned int*,void*); static void *rv_handle=NULL; @@ -167,9 +189,9 @@ } // setup rv30 codec (codec sub-type and image dimensions): if(extrahdr[1]>=0x20200002){ - unsigned long cmsg24[4]={sh->disp_w,sh->disp_h,sh->disp_w,sh->disp_h}; - unsigned long cmsg_data[3]={0x24,1+((extrahdr[0]>>16)&7),(unsigned long) &cmsg24}; - (*rvyuv_custom_message)(cmsg_data,sh->context); + uint32_t cmsg24[4]={sh->disp_w,sh->disp_h,sh->disp_w,sh->disp_h}; + cmsg_data_t cmsg_data={0x24,1+((extrahdr[0]>>16)&7), &cmsg24[0]}; + (*rvyuv_custom_message)(&cmsg_data,sh->context); } mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: RealVideo codec init OK!\n"); return 1; @@ -198,12 +220,12 @@ unsigned char* dp_data=((unsigned char*)data)+sizeof(dp_hdr_t); uint32_t* extra=(uint32_t*)(((char*)data)+dp_hdr->chunktab); - unsigned long transform_out[5]; - unsigned long transform_in[6]={ + unsigned int transform_out[5]; + transform_in_t transform_in={ dp_hdr->len, // length of the packet (sub-packets appended) 0, // unknown, seems to be unused dp_hdr->chunks, // number of sub-packets - 1 - (unsigned long) extra, // table of sub-packet offsets + extra, // table of sub-packet offsets 0, // unknown, seems to be unused dp_hdr->timestamp,// timestamp (the integer value from the stream) }; @@ -214,7 +236,7 @@ sh->disp_w, sh->disp_h); if(!mpi) return NULL; - result=(*rvyuv_transform)(dp_data, mpi->planes[0], transform_in, + result=(*rvyuv_transform)(dp_data, mpi->planes[0], &transform_in, transform_out, sh->context); return (result?NULL:mpi);