Also, don't bother with saving/restoring data, av_init_packet doesn't touch it.
Attach a file by drag & drop or click to upload