[FFmpeg-devel] [PATCH 2/2] avcodec/noise_bsf: move the reference in the bsf internal buffer

Michael Niedermayer michael at niedermayer.cc
Sun Mar 18 03:54:36 EET 2018


On Sat, Mar 17, 2018 at 10:39:25PM -0300, James Almer wrote:
> On 3/17/2018 10:28 PM, Michael Niedermayer wrote:
> > On Fri, Mar 16, 2018 at 08:16:01PM -0300, James Almer wrote:
> >> There's no need to allocate a new packet for it.
> >>
> >> Signed-off-by: James Almer <jamrial at gmail.com>
> >> ---
> >>  libavcodec/noise_bsf.c | 30 ++++++++----------------------
> >>  1 file changed, 8 insertions(+), 22 deletions(-)
> > 
> > should be ok assumung the the packet from ff_bsf_get_packet_ref can be
> > modified, this is not documented in bsf.h
> 
> Yes, ff_bsf_get_packet_ref() moves the reference from the internal bsf
> packet as stored by av_bsf_send_packet() to the already allocated packet
> passed by the caller, whereas ff_bsf_get_packet() hands a newly
> allocated packet with the reference to the caller.

what i meant is that the docs dont say that the caller can
modify pkt->data without using some *make_writable() function

also while ff_bsf_get_packet() documents freeing requirements,
ff_bsf_get_packet_ref leaves this ambigous, from must over can
to a must not.

that is the docs should be made clearer assuming it is all correct

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20180318/06a6de27/attachment.sig>


More information about the ffmpeg-devel mailing list