[MPlayer-dev-eng] [PATCH] Support CineForm DirectShow codec

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 9 18:22:13 CET 2010


On Sun, Jan 10, 2010 at 05:09:17PM +0100, Steinar H. Gunderson wrote:
> On Sun, Jan 10, 2010 at 04:39:27PM +0100, Reimar Döffinger wrote:
> > Applied.
> 
> OK, here's the next patch; new stub functions only.

Hm, most of them do not match the specification much, I think it fixed them,
but I don't know if they will still work for you.
Explanation of changes:

> +static int WINAPI expGetModuleBaseNameA(int process, int module, char* s, int len)
> +{
> +    int result = 0;
> +   
> +    if (len >= 12) {
> +	strcpy(s, "aviplay.dll");
> +	result = 11;
> +    }
> +
> +    dbgprintf("GetModuleBaseNameA(0x%x, 0x%x, 0x%x, %d) => %d\n",
> +        process, module, s, len, result);
> +
> +    return result;
> +}

Changed to return partial string instead of failing if buffer too small.

> +static char* WINAPI expSysAllocStringLen(char *pch, unsigned cch)
> +{
> +    char *str;
> +    dbgprintf("SysAllocStringLen('%s', %d)\n", pch, cch);
> +    str = (char *)malloc(cch * 2 + sizeof(unsigned) + 2);
> +    if (pch != NULL) {
> +        memcpy(str + sizeof(unsigned), pch, cch * 2);
> +    }
> +    *(str + sizeof(unsigned) + cch * 2) = 0;
> +    *(str + sizeof(unsigned) + cch * 2 + 1) = 0;
> +    memcpy(str, &cch, sizeof(cch));
> +    return str + sizeof(unsigned);
> +}

Should just be a simplification.

> +static DWORD WINAPI expGetLocaleInfoA(DWORD locale, DWORD lctype, char* lpLCData, int cchData)
> +{
> +    if (lctype == 0x1004) {  // LOCALE_IDEFAULTANSICODEPAGE
> +       strcpy(lpLCData, "437");
> +       return 0;
> +    }
> +    return 1;
> +}

Changed to return the number of bytes copied instead of an error for LOCALE_IDEFAULTANSICODEPAGE
and to return an error for all other cases (also handling too small buffer and cchData == 0
cases).
I'm almost certain this won't work anymore, but who knows.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stubs.diff
Type: text/x-diff
Size: 4845 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100209/03ad49e2/attachment.diff>


More information about the MPlayer-dev-eng mailing list