Web lists-archives.com

Re: [MPlayer-dev-eng] [PATCH] MNG detection fails with libjpeg-turbo

On 2017-11-26 at 15:36, The Wanderer wrote:

> With current SVN (and for as long as I can remember checking), the
> configure check for the availability of libmng fails. Today I finally
> got around to looking into why.
> The test performs a compile check against libmng.h, which includes
> jpeglib.h. With libjpeg-turbo (the source of jpeglib.h in current
> Debian), this test fails because FILE is undefined. This is typedef is
> normally expected to come from stdio.h.
> https://github.com/libjpeg-turbo/libjpeg-turbo/issues/17
> indicates that this is intentional, for backwards compatibility with
> libjpeg, and that "it is actually a design requirement of the libjpeg
> API that you include stdio.h before including jpeglib.h.".
> This would seem to indicate that this has been broken for a very long
> time, and quite possibly no one noticed (which would imply that no one
> bothered trying to compile with MNG support). The last MNG-related
> commits seem to have been in 2012; support was originally added in 2011.
> The compilation check is performed by the return_statement_check
> function, which only permits passing one header-file argument. There is
> an existing statement_check_broken function, specifically for use with
> headers which don't include some of their own dependencies; however, it
> hardcodes a 'return 0', whereas return_statement_check permits passing
> in an expression to be used in the return statement.
> Rather than try to add an ' 0' to all callers of statement_check_broken,
> I've duplicated it into return_statement_check_broken, which adds the
> return-statement argument from return_statement_check.
> With that, detection of libmng succeeds. With an include of stdio.h
> added to vo_mng.c, compilation also succeeds.

And, just for the record, the result of compilation does appear to work;
playing a file with 'vo mng:output=/path/to/file.mng' causes the file to
be created (though only when the player exits, for some reason), and the
resulting file can be played back.

   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature

MPlayer-dev-eng mailing list