[MPlayer-dev-eng] [PATCH] fix direct3d crash on window minimization

Alexander Strasser eclipse7 at gmx.net
Sat Nov 12 18:27:49 CET 2011


Hi,

Roger Pack wrote:
> >  I am not familiar enough with vo direct3d to tell you if the patch
> > is a correct solution. The whole OSD rendering mechanism in vo direct3d
> > was a bit to complex for me to grasp immediately.
> >
> >  But at the very least the comments are inaccurate after your patch is
> > applied. This in itself is a rather bad sign. Therefore the patch should
> > not be committed as is.
> >
> >  How would you modify the comments after your change? No need to change
> > the patches yet! Just write us how you would extend the comments.
> 
> Hmm.
> After looking a bit more closely, I think maybe only the last "3rd" of
> the commit is probably needed.
> So...I would modify that and I guess leave the comments the same [?]
> 
> @@ -1029,7 +1029,7 @@
>  static void draw_osd(void)
>  {
>      // we can not render OSD if we lost the device e.g. because it
> was uncooperative
> -    if (!priv->d3d_device)
> +    if (!priv->d3d_device || !priv->d3d_texture_osd)
>          return;

  This comment is not worded the same as the others, but I think
it conveys the same meaning. So this would only reduce the number
of problem instances to one but the comment would still have to be
changed.

  I looked a bit deeper, so here comes my analysis:

  If the window is minimized the VO gets a resize event. When
handling the resize event, vo direct3d destroys the osd textures
and creates them again with a size fitting the new window size.

  This works well normally, but fails in case of minimization
because then the sizes are 0 and the texture creation fails.
This causes the crash later when draw_osd() gets invoked.

  I did not think about a proper solution yet.

  Alexander


More information about the MPlayer-dev-eng mailing list