[FFmpeg-devel] [PATCH] cbs_mpeg2_split_fragment(): cache the buffer end

Scott Theisen scott.the.elm at gmail.com
Thu Sep 22 21:26:23 EEST 2022


On 9/22/22 10:59, Anton Khirnov wrote:
> Quoting Scott Theisen (2022-09-16 19:41:43)
>> Ping; it still applies cleanly.
> Missing motivation for this change. Is it faster, or why is the new code
> better?
>

To make it easier to read.  `buf_end` is shorter than `frag->data + 
frag->data_size`.  Initialize `start` to `frag->data` so the calls to 
avpriv_find_start_code are the same.

I realize readability is an opinion, but I felt that saving the buffer 
end to a variable and tweaking the comments increased the readability of 
the code.

Regards,

Scott


More information about the ffmpeg-devel mailing list