[FFmpeg-devel] [PATCH] don't set is_streamed when it's not
Aurelien Jacobs
aurel
Fri Dec 21 00:22:01 CET 2007
Michael Niedermayer wrote:
> On Thu, Dec 20, 2007 at 07:30:04PM +0100, Reimar D?ffinger wrote:
> > Hello,
> > On Thu, Dec 20, 2007 at 01:16:11PM -0500, Rich Felker wrote:
> > > On Thu, Dec 20, 2007 at 10:33:38AM +0100, Michael Niedermayer
> > > wrote:
> > [...]
> > > > What is the advantage of having one get and one set function
> > > > for each field in ByteIOContext compared to direct access to
> > > > ByteIOContext? Will you also propose to add such get/set
> > > > functions for each field in AVCodecContext and AVFormatContext ?
> > >
> > > I agree with Michael here. Just have a policy of not reordering
> > > fields and adding new ones only at the end. Then direct access is
> > > possible and ABI is never broken. All this wrapper function mess
> > > reaks of C++ and has no practical benefit.
> >
> > Well, it has the disadvantage that it can be used without calling an
> > allocation function, thus making sure that adding new fields will
> > break, and worse it will break in a very hard to find way.
>
> as ive suggested on mplayer-dev
>
> Simply putting
> char end[INT_MAX/2];
> at the end of the structure if its #included outside lav* makes misuse
> harder.
Won't prevent misuse of ByteIOContext such as direct access to
its buffer.
Aurel
More information about the ffmpeg-devel
mailing list