[FFmpeg-devel] [PATCH] avformat/utils: use the existing packet reference when parsing complete frames

Michael Niedermayer michael at niedermayer.cc
Fri Apr 13 21:59:02 EEST 2018


On Thu, Apr 12, 2018 at 03:34:29PM -0300, James Almer wrote:
> 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.
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavformat/utils.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)

LGTM

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180413/04c0e838/attachment.sig>


More information about the ffmpeg-devel mailing list