On Sun, Dec 21, 2008 at 1:00 AM, AliReza Khoshgoftar
<[email protected]> wrote:
> Thanks for the replies,
> I still have some confusions with the "AVPackets",
> Imagine I have a packet of type "AVPacket"
> To zero out its data I used to use:
>
> * for( k=0 ; k < packet.size ; k++)*
> *                   packet.data[k] = 0;*
>
>
> but seemingly I had an incorrect assumption here(the assumption was
> "packet.size" is actually "sizeof(packet.data)", but when I checked the
> values, the former is of order of 1000, while the latter is simply 4)
>
> First of all it is really weired for me that for a video
> "sizeof(packet.data) = 4", does it mean "packet.data" is an array of only 4
> "uint8_t"s???
> An second, what is "packet.size", if it is not the number of elements in
> "packet.data" array?

it's a dynamically allocated pointer, you'll get the size of a 32bit
or 64bit pointer when doing a sizeof.
Because of this you get packet.size it refers to the real size of
pkt.data, if you could use
sizeof there wouldn't be a use for the extra information.

> And Third, how can I zero out my whole packet's data?
>

memset(packet.data, 0x0, packet.size);

best regards,
Markus
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to