[MPlayer-dev-eng] runtime VIDIX driver directory
Ulion
ulion2002 at gmail.com
Mon Dec 17 05:54:18 CET 2007
2007/12/17, Ulion <ulion2002 at gmail.com>:
> 14 Dec 2007 04:25:37 +0000, Bryan Henderson <bryanh at giraffe-data.com>:
> > This patch lets the environment variable MP_VIDIX_PFX override the built-in
> > prefix (directory) for VIDIX drivers. So an MPlayer executable is portable.
> >
> > --- MPlayer/libvo/vosub_vidix.c 2007-11-25 22:32:26.000000000 +0000
> > +++ MPlayer/libvo/vosub_vidix.c 2007-11-26 08:46:49.000000000 +0000
> > @@ -706,6 +706,22 @@
> > // return server_control(request,data); //VO_NOTIMPL;
> > }
> >
> > +static char *
> > +vidix_driver_pfx(void) {
> > +
> > + char * path;
> > +
> > + path = getenv("MP_VIDIX_PFX");
> > + if (!path) {
> > +#ifndef __MINGW32__
> > + path = MP_VIDIX_PFX;
> > +#else
> > + path = get_path("vidix/");
> > +#endif
> > + }
> > + return path;
> > +}
> > +
> > int vidix_preinit(const char *drvname,void *server)
> > {
> > int err;
> > @@ -716,17 +732,11 @@
> > mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_SUB_VIDIX_YouHaveWrongVersionOfVidixLibrary);
> > return -1;
> > }
> > -#ifndef __MINGW32__
> > - vidix_handler = vdlOpen(MP_VIDIX_PFX,
> > - drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL,
> > - TYPE_OUTPUT,
> > - verbose);
> > -#else
> > - vidix_handler = vdlOpen(get_path("vidix/"),
> > +
> > + vidix_handler = vdlOpen(vidix_driver_pfx(),
> > drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL,
> > TYPE_OUTPUT,
> > verbose);
> > -#endif
> >
> > if(vidix_handler == NULL)
> > {
>
> Check the implement code of 'vdlOpen' in vidix/vidixlib.c, the path
> never get used.
Oh, the external vidix lib use it.
The get_path("vidix/") return string need be freed after the vdlOpen
call, you should fix it.
--
Ulion
More information about the MPlayer-dev-eng
mailing list