[MPlayer-dev-eng] Direct3D OSD discussion

Jim Hauxwell james at dattrax.co.uk
Mon Dec 8 19:29:56 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Georgi Petrov wrote:
> /** @brief libvo Callback: Draw OSD/Subtitles,
>  */
> static void draw_osd(void)
> {
>     if (vo_osd_changed(0)) {
>         D3DLOCKED_RECT  locked_rect;   /**< Offscreen surface we lock in order
>                                          to copy MPlayer's frame inside it.*/
> 
> 
> locked_rect shadows the global variable priv->locked_rect. I know this
> is not a problem, but may create confusion in the future.

The priv->locked_rect is locking a surface the size of the playing video
, and the local locking is for the size of the display.  So in this case
it is not a 'shadow' of the other lock, as the parameters are different.

Now I want to answer all your questions in one post...  Aaaarg

> What's C "speed policy" about such declared pointers inside the for
> statement? Would it be better this this way (speed wise):

Should be non as its just a cast to make the compiler do the correct
address calculation in the loop

> /* clear the whole texture to avoid issues due to interpolation */
>         memset(locked_rect.pBits, 0, locked_rect.Pitch *
> priv->osd_texture_height);
>
> This is most likely not correct. Pitch != Width!!!!!

Yes, but pitch is guaranteed to be greater than width, so it is correct.
 Otherwise you would have to loop over the clear and probably get a
slower solution, given that memset is normally well optimized on most
systems.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk9Z6MACgkQhrNWoHjgI1DLtACgnT6pPdzSGvYh+xmfd5xJ8Jw/
HqAAoI8yiW1LvMtlzOvz9SO0elEEYaIn
=I3dh
-----END PGP SIGNATURE-----




More information about the MPlayer-dev-eng mailing list