[FFmpeg-devel] [PATCH 1/5] avformat/utils: make AVPacketList helper functions shared
Michael Niedermayer
michael at niedermayer.cc
Tue Mar 27 23:22:43 EEST 2018
On Mon, Mar 26, 2018 at 03:02:35PM -0300, James Almer wrote:
> Based on a patch by Luca Barbato.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> libavformat/internal.h | 35 ++++++++++++++++++++++++++++++++++
> libavformat/utils.c | 51 +++++++++++++++++++++++++++-----------------------
> 2 files changed, 63 insertions(+), 23 deletions(-)
>
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index a020b1b417..7e1b24ebe6 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -731,6 +731,41 @@ int ff_unlock_avformat(void);
> */
> void ff_format_set_url(AVFormatContext *s, char *url);
>
> +/**
> + * Append an AVPacket to the list.
> + *
> + * @param head List head
> + * @param tail List tail
about the terminology
Shouldnt this be a single List element or 2 ListEntry elements ?
> + * @param pkt The packet being appended
> + * @param ref Create a new reference for the packet instead of
> + transferring the ownership of the existing one to the
> + * list.
> + * @return < 0 on failure and 0 on success
if its an AVERROR code on failure this should be documented, ATM it just
says some unspecifified negative value
> + */
> +int ff_packet_list_put(AVPacketList **head, AVPacketList **tail,
> + AVPacket *pkt, int ref);
ref should not be a int but a enum
ff_packet_list_put(,,,1)
ff_packet_list_put(,,,0)
is alot more confusing to a new developer than with english words
the code should be self explanatory not requiring looking up the
documentation
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/20180327/3413a648/attachment.sig>
More information about the ffmpeg-devel
mailing list