[MPlayer-G2-dev] demux_packet_t question

Arpi arpi at thot.banki.hu
Mon Jul 21 21:22:51 CEST 2003


Hi,

> what's the use of the last 8 bytes in new_demux_packet() ?

some codecs - libavcodec - reads a few bytes (ma x8) more than
required (due to buffering of get_bits) so to avoid sig11 we allocate
8 bytes more. it's nasty, but a lot faster than boundary checking in
get_bits() which is called million times per frame.

> dp->buffer=len?(unsigned char*)malloc(len+8):NULL;
>   if(len) memset(dp->buffer+len,0,8);
> 
> If I want to change via realloc() the size of the packet (I know it' 
> nasty, but just to know)
> how should I reflect the change in these last 8 bytes ?

dunno, depends on codec you will use
overallocating doesnt hurt


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-G2-dev mailing list