[MPlayer-dev-eng] [PATCH] Direct3D VO better handling of uncooperative video adapter

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Feb 3 11:24:45 CET 2009


On Tue, Feb 03, 2009 at 11:41:10AM +0200, Georgi Petrov wrote:
> > I think it might be because reconfigure_d3d has already released the device.
> > In that case, you do not need that uncooperative variable but can just check for
> > if (!priv->d3d_device) ...
> 
> Great. I submit much simpler patch, which works very well and changes
> only a few lines to to the same. I check exactly for
> !priv->d3d_device. Please, take a look.

You really shouldn't change the mp_msgs in the same patch, it makes it
needlessly hard to understand.
Also have you thought about but ensure_..._created/ensure_..._freed
system? Currently it is possible (though unlikely) that we have e.g. a
valid d3d_device but not video texture.

> @@ -857,21 +862,16 @@
>  static void flip_page(void)
>  {
>      RECT rect = {0, 0, vo_dwidth, vo_dheight};
> -    if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) {
> +    if (!priv->d3d_device ||
> +        FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) {
>          mp_msg(MSGT_VO, MSGL_V,
> -               "<vo_direct3d>Video adapter became uncooperative.\n");
> -        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Trying to reinitialize it...\n");
> +               "<vo_direct3d>Trying to reinitialize uncooperative video adapter.\n");
>          if (!reconfigure_d3d()) {
> -            mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization Failed.\n");
> +            mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization failed.\n");
>              return;
>          }
> -        if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) {
> -            mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization Failed.\n");
> -            return;
> -        }

Why are you removing it? I guess it can't work, but if so it should be
done in a separate patch with the reason explained in the commit
message.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list