[MPlayer-dev-eng] [PATCH] Direct3D Much better D3D management

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Dec 2 10:43:59 CET 2008


Hello,

applied.

On Tue, Dec 02, 2008 at 01:06:28AM +0200, Georgi Petrov wrote:
> +    if (priv->d3d_backbuf != NULL) {
> +        IDirect3DSurface9_Release(priv->d3d_backbuf);
> +        priv->d3d_backbuf = NULL;
>      }

Btw. have you tried what happens when you call Release on a NULL
pointer?
All these checks might be unnecessary.
Also, if they are needed, what do you think about writing

>     if (priv->d3d_backbuf)
>         IDirect3DSurface9_Release(priv->d3d_backbuf);
>     priv->d3d_backbuf = NULL;

Instead? I cam to prefer it because
1) It is more obvious that priv->d3d_backbuf is always NULL afterwards
2) you save the {}, and essential it becomes just a "guard-if" for the
   called function.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list