av_packet_clone both allocates an AVPacket structure and makes a new reference to the underlying buffer. av_interleaved_write_frame only calls av_packet_unref when it's done with the packet, it doesn't actually free it.
av_packet_clone both allocates an AVPacket structure and makes a new reference to the underlying buffer. av_interleaved_write_frame only calls av_packet_unref when it's done with the packet, it doesn't actually free it.