[MPlayer-dev-eng] [PATCH v2] Support newer GIFLIB versions

Alexander Strasser eclipse7 at gmx.net
Thu Jul 25 22:59:12 CEST 2013


Hi Diego,

On 2013-07-25 11:10 +0200, Diego Biurrun wrote:
> On Thu, Jul 25, 2013 at 01:05:15AM +0200, Alexander Strasser wrote:
> > Work with GIFLIB version >= 4.2
> 
> When was giflib 5 released?

  around 2012-06-19, I'd say...

> > --- a/libmpdemux/demux_gif.c
> > +++ b/libmpdemux/demux_gif.c
> > @@ -45,6 +45,32 @@ typedef struct {
> >  
> >  #define GIF_SIGNATURE (('G' << 16) | ('I' << 8) | 'F')
> >  
> > +#if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5
> 
> The defined check is kind of redundant.  If GIFLIB_MAJOR is not defined,
> its value is equal to '0'.  So this could be simplified, but at the cost
> of a warning for cases when GIFLIB_MAJOR is undefined.

  I know, had it first that way but decided in to change
it to avoid the warning when compiling against older versions.
The GIFLIB_MAJOR #define was first introduced at 4.2 release.

> > +#define DGifOpen(a, b) DGifOpen(a, b, NULL)
> > +#define DGifOpenFileHandle(a) DGifOpenFileHandle(a, NULL)
> > +#define GifError() (gif ? gif->Error : 0)
> > +#define GifErrorString() GifErrorString(gif->Error)
> > +#endif
> > +
> > +/* >= 4.2 prior GIFLIB did not have MAJOR/MINOR defines */
> > +#if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 4
> 
> #elif

  I don't think so. The #defines at the top are only needed
with GIFLIB version >=5. The #if part is needed with GIFLIB 4.2
and upwards (including 5) the #else is for all earlier versions
(e.g. 4.1.6).

> > +static void print_gif_error(GifFileType * gif)
> 
> *gif

  Changed.

  I rebased against current svn; will commit soon.

  Alexander


More information about the MPlayer-dev-eng mailing list