[FFmpeg-devel] [PATCH] Rename ff_random_get_seed to av_*, export the header

Stefano Sabatini stefano.sabatini-lala
Sat May 15 13:48:43 CEST 2010


On date Friday 2010-05-14 21:13:18 +0300, Martin Storsj? encoded:
> On Fri, 14 May 2010, Michael Niedermayer wrote:
> 
> > On Fri, May 14, 2010 at 11:57:46AM +0300, Martin Storsj? wrote:
> > > On Fri, 14 May 2010, Benoit Fouet wrote:
> > > 
> > > > On Fri, 14 May 2010 11:00:29 +0300 (EEST) Martin Storsj? wrote:
> > > > > On Fri, 14 May 2010, Benoit Fouet wrote:
> > > > > 
> > > > > > On Fri, 14 May 2010 09:57:58 +0300 (EEST) Martin Storsj? wrote:
> > > > > > > diff --git a/libavutil/random_seed.h b/libavutil/random_seed.h
> > > > > > > index a954381..db4fe5d 100644
> > > > > > > --- a/libavutil/random_seed.h
> > > > > > > +++ b/libavutil/random_seed.h
> > > > > > [...]
> > > > > > > +#if LIBAVUTIL_VERSION_MAJOR < 51
> > > > > > > +attribute_deprecated uint32_t ff_random_get_seed(void);
> > > > > > > +#endif
> > > > > > >  
> > > > > > 
> > > > > > I don't think this one should be added.
> > > > > > The ffmpeg tree should be fixed instead.
> > > > > 
> > > > > Yes, it is fixed in the second patch. But it is still needed after that.
> > > > > 
> > > > > Current versions of libavformat link directly to this symbol, and if the 
> > > > > libavutil shared library is updated to a version without the symbol, the 
> > > > > older libavformat will fail to load.
> > > > 
> > > > why ? It should link.
> > > > You have defined the symbol, I just don't see why you should add a
> > > > prototype for it.
> > > 
> > > Ah, you meant only the prototype, not the whole backwards compatibility 
> > > function as such, I misunderstood.
> > > 
> > > With the current compiler flags, you'd get a
> > > libavutil/random_seed.c:48: error: no previous prototype for 
> > > 'ff_random_get_seed'
> > > error if the prototype is missing.
> > 
> > i think the prototype could be put in the c file then
> 
> Ok, so like this then?
> 
> // Martin

> From d55c1e853481be06e28f6edf01bc2be7327ed301 Mon Sep 17 00:00:00 2001
> From: Martin Storsjo <martin at martin.st>
> Date: Fri, 14 May 2010 09:48:23 +0300
> Subject: [PATCH] Make ff_random_get_seed public by renaming to av_*, export the header
> 
> Keep an old ff_ named function for binary compatibility until the
> next major bump.
> ---
>  ffserver.c               |    2 +-
>  libavfilter/parseutils.c |    2 +-
>  libavformat/httpauth.c   |    2 +-
>  libavformat/mxfenc.c     |    2 +-
>  libavformat/rtpenc.c     |    4 ++--
>  libavutil/Makefile       |    1 +
>  libavutil/random_seed.c  |   11 ++++++++++-
>  libavutil/random_seed.h  |    2 +-
>  8 files changed, 18 insertions(+), 8 deletions(-)

What about av_get_random_seed()?, it sounds better than
av_random_get_seed().

Apart from this, Looks fine to me, don't forget to bump lavu minor
when committing and add an entry to APIchanges in a separate commit.

Regards.
-- 
FFmpeg = Freak & Funny Martial Peaceless Erotic Game



More information about the ffmpeg-devel mailing list