The most substantial memory leak came from `PacketQueue::get` not unreferencing its argument packet. Other leaks came from using `av_free` instead of type-specific free functions. Also modifies `PacketQueue::put` for readability.