[Libav-user] Pb use av_new_packet

Alex Cohn alexcohn at netvision.net.il
Thu Feb 14 23:13:37 CET 2013


On Thu, Feb 14, 2013 at 12:50 PM, Jérôme SALAYET
<jerome.salayet at hymatom.fr> wrote:
> Hello, I use av_init_packet in my code to decompress H264 streaming.
>
> But it seems better for me to use av_new_packet because I don’t have to use
> my lpFFMPEGBuffer. But When I try to replace in my code:

Yes, it's not clear why you need that extra buffer, or CopyMemory() at
all. If you can guarantee that lpImageData points to a chunk of memory
big enough, you can simply

  // Set the buffer to packet data
  m_lpPacket.data = lpImageData;

BR,
Alex


More information about the Libav-user mailing list