]> git.sesse.net Git - ffmpeg/commit
avformat/utils: use the existing packet reference when parsing complete frames
authorJames Almer <jamrial@gmail.com>
Thu, 12 Apr 2018 03:06:30 +0000 (00:06 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 14 Apr 2018 00:19:22 +0000 (21:19 -0300)
commit23e994ca496c51f67d764ffa48be715c877883e5
treecdd95a010ce50b837f867f142a7338a72162312c
parentb14761d1f8372dfe558193b8b754b9f1a858077d
avformat/utils: use the existing packet reference when parsing complete frames

If the parser returns full frames, then the output pointer retured by
av_parser_parse2() is guaranteed to point to data contained in the
input packet's buffer.

Create a new reference to said buffer in that case, to avoid
unnecessary data copy when queueing the packet later in the function.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/utils.c