[MPlayer-dev-eng] [PATCH] mencoder to load win32 codecs properly
Guillaume POIRIER
poirierg at gmail.com
Tue Oct 4 23:23:44 CEST 2005
Hi,
On 10/2/05, Zuxy <zuxy.meng at gmail.com> wrote:
> Hi,
>
> Under Win32 mencoder doesn't add codecs directory to %PATH% as mplayer does,
> so when you want to use win32 codecs to decode source file it complaints about
> unavailable codecs. The fix is straight foward: just copy relative pieces from
> mplayer.c.
>
> --- MPlayer-1.0pre7try2\mencoder.c Wed Apr 6 15:58:30 2005
> +++ MPlayer-1.0pre7try2.new\mencoder.c Fri Sep 30 02:47:48 2005
> @@ -452,6 +452,40 @@
> #endif
> #endif
>
> +
> +#if defined(WIN32) && defined(USE_WIN32DLL)
> +{ /*make our codec dirs available for LoadLibraryA()*/
> + char tmppath[MAX_PATH*2 + 1];
> + char win32path[MAX_PATH];
> + char realpath[MAX_PATH];
> +#ifdef __CYGWIN__
> + cygwin_conv_to_full_win32_path(WIN32_PATH,win32path);
> + strcpy(tmppath,win32path);
> +#ifdef USE_REALCODECS
> + cygwin_conv_to_full_win32_path(REALCODEC_PATH,realpath);
> + sprintf(tmppath,"%s;%s",win32path,realpath);
> +#endif /*USE_REALCODECS*/
> +#else
> + if(!strstr(WIN32_PATH,":")){
> + GetModuleFileNameA(NULL, win32path, MAX_PATH);
> + strcpy(win32path + strlen(win32path) - strlen("mencoder.exe"),
> WIN32_PATH);
> + }
> + else strcpy(win32path,WIN32_PATH);
> + strcpy(tmppath,win32path);
> +#ifdef USE_REALCODECS
> + if(!strstr(REALCODEC_PATH,":")){
> + GetModuleFileNameA(NULL, realpath, MAX_PATH);
> + strcpy(realpath + strlen(realpath) - strlen("mencoder.exe"),
> REALCODEC_PATH);
> + }
> + else strcpy(realpath,REALCODEC_PATH);
> + sprintf(tmppath,"%s;%s",win32path,realpath);
> +#endif /*USE_REALCODECS*/
> +#endif /*__CYGWIN__*/
> + SetEnvironmentVariableA("PATH", tmppath);
> +}
> +#endif /*WIN32 && USE_WIN32DLL*/
> +
> +
> +
> InitTimer();
>
> // check codec.conf
I don't know if this patch still applies cleanly to CVS (there has
been a fair deal of commits to mencoder.c since pre7).
Could you please resend a patch against CVS as an attachment?
Guillaume
--
Reading doesn't hurt, really!
-- Dominik 'Rathann' Mierzejewski
More information about the MPlayer-dev-eng
mailing list