On Fri, Aug 30, 2019 at 04:26:57PM -0300, James Almer wrote: > Some decoders may not need a writable buffer in some specific cases, but only > a reference to the existing buffer with updated frame properties instead, for > the purpose of returning duplicate frames. > > Signed-off-by: James Almer <jamr...@gmail.com> > --- [...] > diff --git a/libavcodec/internal.h b/libavcodec/internal.h > index 5f964148fd..d12040f47e 100644 > --- a/libavcodec/internal.h > +++ b/libavcodec/internal.h > @@ -321,10 +321,10 @@ static av_always_inline float ff_exp2fi(int x) { > int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); > > /** > - * Identical in function to av_frame_make_writable(), except it uses > - * ff_get_buffer() to allocate the buffer when needed. > + * Identical in function to ff_get_buffer(), except it reuses the existing > buffer > + * if available and ensures it's writable when requested. > */ > -int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame); > +int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int writable);
I suggest using named constants instead of 0 and 1 #define BUF_TYPE_WRITEABLE 1 #define BUF_TYPE_READONLY 0 This makes the code easier to understand patch LGTM either way thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".