[Xvid-devel] Patch for XVID MPEG-4 DirectShow/MediaFoundation filter

Matias N. Goldberg dark_sylinc at yahoo.com.ar
Mon Jun 13 16:41:52 CEST 2011


I'm not liking it. Why are there conflicts (I admit, I haven't tried building the unicode version myself)? It ought to work by defining UNICODE  globally and setting in "Use Unicode Character Set" in Character Set config from MSVC solution.

The string constants should be using a character set independent function, like _T() That's how you deal with conflict calls.

For example:
Incorrect:
wsprintf(core, "Xvid MPEG-4 Video Codec v%d.%d.%d", );
wsprintfA(core, "Xvid MPEG-4 Video Codec v%d.%d.%d", );
wsprintfW(core, L"Xvid MPEG-4 Video Codec v%d.%d.%d", );

Correct:
wsprintf(core, _T("Xvid MPEG-4 Video Codec v%d.%d.%d"), );

Changing from explicit ANSI or UTF-8 to explicit UNICODE UTF-16 is just dragging the same problem with a different character set.

If still, there's something that needs to be explicit (for some very weird reason), please use:
#ifndef UNICODE
  //Do something
#else
  //Do something with explicit unicode calls.
#endif

BTW, wide version may omit the conversion stage, but it also consumes more memory and bandwidth (which is usually worse). Nevertheless, this shouldn't be considered by it's performance at all, since it only takes an insignificant amount of CPU time compared to XviD's overal time, which is it's actual job.

Cheers
Dark Sylinc

IMPORTANT:
The information contained in this email may be commercially sensitive and/or legally privileged.
It is intended solely for the person(s) to whom it is addressed. If the reader of this message is not the intended recipient, you are on notice of its status and hereby notified that your access is unauthorized, and any review,
dissemination, distribution, disclose or copying of this message including any attachments is strictly prohibited.
Please notify the sender immediately by reply e-mail and then delete this message from your system.


--- El lun 13-jun-11, Jerker Bäck <jerker.back at gmail.com> escribió:

> De: Jerker Bäck <jerker.back at gmail.com>
> Asunto: Re: [Xvid-devel] Patch for XVID MPEG-4 DirectShow/MediaFoundation filter
> Para: xvid-devel at xvid.org
> Fecha: lunes, 13 de junio de 2011, 10:22
> Hi Michael,
> 
> > If it's a short patch ...
> Well, it is simple but rather long so here you go:
> 
> http://pastebin.com/xXPrSuMP
> 
> Basically the patch neutralizes the effect of the UNICODE
> define by
> explicitly use wide char versions of conflicting functions.
> In effect it
> doesn't matter if you choose undefined, MBCS or UNICODE
> character set.
> 
> cheers
> Jerker
> 
> 
> _______________________________________________
> Xvid-devel mailing list
> Xvid-devel at xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
> 


More information about the Xvid-devel mailing list