[MPlayer-dev-eng] [PATCH] fix mencoder compilation with lavf X11 demuxer

Rich Felker dalias at aerifal.cx
Thu Dec 14 21:54:52 CET 2006


On Thu, Dec 14, 2006 at 10:29:36AM +0100, Michael Niedermayer wrote:
> > > Can x11grab be easily disabled? More specifically, I'm trying to avoid
> > > unnecessary dependencies in mencoder for binary packages. MEncoder doesn't
> > > depend on any X11 libs currently and I intend to keep it that way.
> > 
> > IMO this reveals a whole cascade of problems:
> > 
> > - there should be a way to disable protocols if there's not already
> 
> patch welcome ...
> 
> 
> > - the protocols should ideally be a separate library/separate level of
> >   abstraction from the muxers/demuxers
> 
> should be easy, pretty much just a few svn mv + Makefile/configure changes
> if iam not missing anything (and patch welcome ...)

:)

> > - wtf? grabbing belongs in a grabber app, not an a/v format library
> 
> well grabbing always was part of libavformat, you complain a little late

Yeah indeed. :)
I still claim it's very poor factoring tho, and that the reason we hit
this problem in the first place (and the reason we have the problem of
having to make fake protocols to hook into the caller's streams) is
that the code wasn't factored correctly to begin with.

> > - libavformat looks more like libffmpegapp than libavformat
> > 
> > Any ideas if there's a desire to fix any of them, and if so, how to go
> > about doing it?
> 
> what about changing the x11grab code to use dlopen() ?

Not portable, XSI-dependent. Certainly doesn't work on Windows without
a dlopen-emulation layer. This is a nice idea but it would need to be
optional, so it's a way of improving the other choices, not a
replacement for one of the other possible fixes.

IMO the best short-term fix is not to remove x11grab entirely, but
make it dependent on a disabled-by-default configure option. This will
at least avoid pulling in X libs for MPlayer/MEncoder and other apps
that use libavformat but have no need for X. Eventually there should
be a clean unified way to disable/enable protocols, or better yet
moving them to their own lib, but first let's fix the show-stopping
bug. (It's still show-stopping even if Diego's build changes are
reverted since it makes non-gui apps like mencoder depend on X, which
is very bad for distro packagers.)

Rich




More information about the MPlayer-dev-eng mailing list