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

wm4 nfxjfg at googlemail.com
Fri May 13 15:10:33 CEST 2016


On Fri, 13 May 2016 15:24:50 +0300
Andriy Lysnevych <andriy.lysnevych at gmail.com> 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 know that there are some projects which dlopen libavcodec, but I
don't know if they'd get broken by this. Either way, at this point I
don't care anymore - if others think this potential breakage is ok, I'm
fine with it.


More information about the ffmpeg-devel mailing list