mpeg2_metadata: Avoid allocations and copies of packet structures
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 19 Jun 2019 23:45:07 +0000 (01:45 +0200)
committerMark Thompson <sw@jkqxz.net>
Sun, 7 Jul 2019 21:59:25 +0000 (22:59 +0100)
commitdd5ce54d2a44ecb8be6c3bb9396839a8d8fb1742
tree0014e638ce34e08b15e2c37d11362f52ac0b8edc
parentbc8b623b83d7962528594e2ee453b96a4ceeeb1e
mpeg2_metadata: Avoid allocations and copies of packet structures

This commit changes mpeg2_metadata to (a) use ff_bsf_get_packet_ref
instead of ff_bsf_get_packet (thereby avoiding one malloc and free per
filtered packet) and (b) to use only one packet structure at all,
thereby avoiding a call to av_packet_copy_props.

(b) has been made possible by the recent changes to ff_cbs_write_packet.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mpeg2_metadata_bsf.c