[FFmpeg-devel] [PATCH] Const src in av_packet_clone declaration

Michael Niedermayer michael at niedermayer.cc
Fri May 13 16:04:40 CEST 2016


On Fri, May 13, 2016 at 03:24:50PM +0300, Andriy Lysnevych wrote:
> > Anyway, example how this change can break:
> >
> > typedef struct AVPacket AVPacket;
> >
> > AVPacket *av_packet_clone_old(AVPacket *src);
> > AVPacket *av_packet_clone_new(const AVPacket *src);
> >
> > AVPacket *(*unsuspecting_api_user)(AVPacket *src);
> >
> > void set(void)
> > {
> >     unsuspecting_api_user = av_packet_clone_old;
> >
> >     unsuspecting_api_user = av_packet_clone_new;
> > }
> >
> 
> You are right. But is this the only example how this change breakes
> compatibility? I don't think many (if any) C++ projects use
> av_packet_clone this way. Also this incompatibility is very easy to
> fix in any project.

i remember there was one project that used libavcodec through placing
all functions as pointers in a struct or something.

i think the const should just be added under appropriate #if version
its the "proper" way to do it and the #if ill get dropped after the
version is bumped

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

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160513/74fb6532/attachment.sig>


More information about the ffmpeg-devel mailing list