[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mplayer-g2-dev
Subject:    Re: [MPlayer-G2-dev] demux_packet_t question
From:       Arpi <arpi () thot ! banki ! hu>
Date:       2003-07-21 19:22:51
Message-ID: 200307211922.h6LJMpGA028175 () mail ! mplayerhq ! hu
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic