diff options
author | aurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-02-09 22:00:57 +0000 |
---|---|---|
committer | aurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-02-09 22:00:57 +0000 |
commit | de03d58545ced64606947dccd877341a127a4a69 (patch) | |
tree | 5369dbcc68c95c8b05b5df9df79294b465117f7c /libmpcodecs/vd_realvid.c | |
parent | 71c200b0cbd80c47f13296c7216e84378460ebf4 (diff) | |
download | mpv-de03d58545ced64606947dccd877341a127a4a69.tar.bz2 mpv-de03d58545ced64606947dccd877341a127a4a69.tar.xz |
change internal real video packetizing format to the more straight forward one
see [MPlayer-dev-eng] [PATCH] cleanup/uniformize real video packetizing
patch blessed by Roberto
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28503 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd_realvid.c')
-rw-r--r-- | libmpcodecs/vd_realvid.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c index a54d11b853..93b303fe8f 100644 --- a/libmpcodecs/vd_realvid.c +++ b/libmpcodecs/vd_realvid.c @@ -9,6 +9,7 @@ #include "mp_msg.h" #include "help_mp.h" +#include "mpbswap.h" #include "vd_internal.h" #include "loader/wine/windef.h" @@ -362,27 +363,23 @@ static void uninit(sh_video_t *sh){ bufsz = 0; } -// copypaste from demux_real.c - it should match to get it working! -typedef struct dp_hdr_s { - uint32_t chunks; // number of chunks - uint32_t timestamp; // timestamp from packet header - uint32_t len; // length of actual data - uint32_t chunktab; // offset to chunk offset array -} dp_hdr_t; - // decode a frame static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mp_image_t* mpi; unsigned long result; - dp_hdr_t* dp_hdr=(dp_hdr_t*)data; - unsigned char* dp_data=((unsigned char*)data)+sizeof(dp_hdr_t); - uint32_t* extra=(uint32_t*)(((char*)data)+dp_hdr->chunktab); + uint8_t *buf = data; + int chunks = *buf++; + int extra_size = 8*(chunks+1); + uint32_t data_size = len-1-extra_size; + unsigned char* dp_data=buf+extra_size; + uint32_t* extra=(uint32_t*)buf; + int i; unsigned int transform_out[5]; transform_in_t transform_in={ - dp_hdr->len, // length of the packet (sub-packets appended) + data_size, // length of the packet (sub-packets appended) 0, // unknown, seems to be unused - dp_hdr->chunks, // number of sub-packets - 1 + chunks, // number of sub-packets - 1 extra, // table of sub-packet offsets 0, // unknown, seems to be unused 0, // timestamp (should be unneded) @@ -397,6 +394,9 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ if (!buffer) return 0; } + for (i=0; i<2*(chunks+1); i++) + extra[i] = le2me_32(extra[i]); + #ifdef CONFIG_WIN32DLL if (dll_type == 1) result=(*wrvyuv_transform)(dp_data, buffer, &transform_in, |