bf8696d02e
Use av_packet_ref() to reference the packet without copy. This also simplifies the logic, by making the "offset" variable and the memcpy() call local to the if-block.