Re: demux_packet_t question

Arpi <[email protected]>
Newsgroups gmane.comp.video.mplayer.g2.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.