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

2016-05-13 Thread Michael Niedermayer
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_a

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

2016-05-13 Thread wm4
On Fri, 13 May 2016 15:24:50 +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_us

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

2016-05-13 Thread Andriy Lysnevych
> 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_p

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

2016-05-13 Thread wm4
On Fri, 13 May 2016 01:08:45 +0300 Andriy Lysnevych wrote: > > That's a change that could break source-compatibility with C++, I don't > think it can be made so easily. > > I do not agree. It extends function so it can take as argument both const > and non-const packets. > > Actually I discov

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

2016-05-12 Thread Andriy Lysnevych
> That's a change that could break source-compatibility with C++, I don't think it can be made so easily. I do not agree. It extends function so it can take as argument both const and non-const packets. Actually I discovered this defect when I was not able to clone const packet in C++ project. __

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

2016-05-12 Thread Carl Eugen Hoyos
wm4 googlemail.com> writes: > > -AVPacket *av_packet_clone(AVPacket *src) > > +AVPacket *av_packet_clone(const AVPacket *src) > > That's a change that could break source-compatibility with C++ How can this breakage be reproduced? Carl Eugen ___ ffmp

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

2016-05-12 Thread wm4
On Thu, 12 May 2016 16:02:48 +0300 Andriy Lysnevych wrote: > --- > libavcodec/avcodec.h | 2 +- > libavcodec/avpacket.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 97b2128..1ad0412 100644 > --- a/libavcodec/avc