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

James Almer jamrial at gmail.com
Sat Apr 14 03:20:04 EEST 2018


On 4/13/2018 3:59 PM, Michael Niedermayer wrote:
> 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

Pushed.


More information about the ffmpeg-devel mailing list