avcodec/dvenc: Avoid copying packet data, allow user-supplied buffers
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sat, 24 Apr 2021 23:43:26 +0000 (01:43 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 8 Jun 2021 10:52:49 +0000 (12:52 +0200)
commit835d8b7401466c2c22d4f439c3c331eb949d793e
tree280ac0753171b8eb7c35323285164d64b3949c3a
parent282b9f4cba7ca361c43ac9f94031a43109df0a4f
avcodec/dvenc: Avoid copying packet data, allow user-supplied buffers

When the packet size is known in advance like here, one can avoid
an intermediate buffer for the packet data; this also makes it easy
to allow user-supplied buffers. Only one thing needed to be changed:
The earlier code relied on the buffer having been initially zeroed
by av_fast_padded_malloc(), so one now needs to zero the packet at
first.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/dvenc.c