[MPlayer-dev-eng] [PATCH] Avisynth native demuxer - working on linux win32 loader

Gianluigi Tiesi mplayer at netfarm.it
Sat Jan 22 22:26:50 CET 2005

I'm trying to make avisynth work on linux, the main problem
is exception hander, but since it's not so trivial to import the
wine exception handler, I've removed some exceptions from avisynth.
I've noticed the call of some imported fuctions has some problem
passing params e.g.:

in avisynth:
AVS_Value AVSC_CC avs_invoke(AVS_ScriptEnvironment * p, const char * name, AVS_Value args, const char * * arg_names)

calling it from demux_avs.c:

mp_msg(MSGT_DEMUX, MSGL_V, "AVS: calling avs_invoke(%p, \"Import\", %p, 0)\n", AVS->avs_env, args);
AVS->handler = AVS->avs_invoke(AVS->avs_env, "Import", args, 0);

I've used lstrcmpiA to output debug string in win32 loader:

AVS: calling avs_invoke(0x876eda0, "Import", 0x10061, 0)
strcmpi(0x100a194c='AVISYNTH', 0x100a1b90='avs_invoke before ::Invoke') => -10
wsprintfA -> 0x876ebdc
strcmpi(0x100a1b7c='avs_invoke p', 0xbfffe1ec='0x876ebdc') => 49
wsprintfA -> 0x876eda0
strcmpi(0x100a1b68='(2) avs_invoke p', 0xbfffe1ec='0x876eda0') => -8
wsprintfA -> 0x876edd0

avisynth code:

    wsprintf(buf, "%p", p);
    lstrcmpiA("avs_invoke p", buf);

    p = (AVS_ScriptEnvironment *) name;
    p->error = 0;

    wsprintf(buf, "%p", p);
    lstrcmpiA("(2) avs_invoke p", buf);

as you can see first param of avs_invoke in demux_avs.c is taken as
second (const char *name) in the loaded dll.

I don't want to make workaround on this, but I don't known if I'm doing
wrong somewhere...


Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/

More information about the MPlayer-dev-eng mailing list