Index: libvo/vo_direct3d.c =================================================================== --- libvo/vo_direct3d.c (revision 28012) +++ libvo/vo_direct3d.c (working copy) @@ -52,6 +52,8 @@ static struct global_priv { int is_paused; /**< 1 = Movie is paused, 0 = Movie is not paused */ + int is_clear_needed; /**< 1 = Clear the backbuffer before StretchRect + 0 = (default) Don't clear it */ D3DLOCKED_RECT locked_rect; /**< The locked Offscreen surface */ RECT fs_movie_rect; /**< Rect (upscaled) of the movie when displayed in fullscreen */ @@ -153,6 +155,12 @@ "Fullscreen Movie Rect: t: %ld, l: %ld, r: %ld, b:%ld\r\n", priv->fs_movie_rect.top, priv->fs_movie_rect.left, priv->fs_movie_rect.right, priv->fs_movie_rect.bottom); + + /* The backbuffer should be cleared before next StretchRect. This is + * necessary because our new draw area could be smaller than the + * previous one used by StretchRect and without it, leftovers from the + * previous frame will be left. */ + priv->is_clear_needed = 1; } /** @brief Destroy D3D Context related to the current window. @@ -325,6 +333,12 @@ return VO_ERROR; } + if (priv->is_clear_needed) { + IDirect3DDevice9_Clear (priv->d3d_device, 0, NULL, + D3DCLEAR_TARGET, 0, 0, 0); + priv->is_clear_needed = 0; + } + if (FAILED(IDirect3DDevice9_StretchRect(priv->d3d_device, priv->d3d_surface, &priv->fs_panscan_rect, @@ -554,7 +568,6 @@ mp_msg(MSGT_VO,MSGL_V,"Video adapter reinitialized.\n"); } - /*IDirect3DDevice9_Clear (priv->d3d_device, 0, NULL, D3DCLEAR_TARGET, 0, 0, 0);*/ } /** @brief libvo Callback: Draw OSD/Subtitles,