[MPlayer-dev-eng] [PATCH] Direct3D return values, cosmetics
Georgi Petrov
gogothebee at gmail.com
Tue Feb 3 10:36:06 CET 2009
Simple patch about some wrong return values, one indentation and one
unneeded capital letter.
-------------- next part --------------
Index: libvo/vo_direct3d.c
===================================================================
--- libvo/vo_direct3d.c (revision 28450)
+++ libvo/vo_direct3d.c (working copy)
@@ -56,7 +56,7 @@
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 */
+ D3DLOCKED_RECT locked_rect; /**< The locked offscreen surface */
RECT fs_movie_rect; /**< Rect (upscaled) of the movie when displayed
in fullscreen */
RECT fs_panscan_rect; /**< PanScan source surface cropping in
@@ -273,10 +273,10 @@
// make sure we respect the size limits without breaking aspect or pow2-requirements
while (tex_width > priv->max_texture_width || tex_height > priv->max_texture_height) {
- osd_width >>= 1;
- osd_height >>= 1;
- tex_width >>= 1;
- tex_height >>= 1;
+ osd_width >>= 1;
+ osd_height >>= 1;
+ tex_width >>= 1;
+ tex_height >>= 1;
}
priv->osd_width = osd_width;
@@ -437,7 +437,7 @@
if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device,
&vp))) {
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to set the viewport\n");
- return VO_ERROR;
+ return 0;
}
calc_fs_rect();
@@ -468,7 +468,7 @@
priv->d3d_handle = Direct3DCreate9(D3D_SDK_VERSION);
if (!priv->d3d_handle) {
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to initialize Direct3D\n");
- return -1;
+ return 0;
}
/* Configure Direct3D */
@@ -492,7 +492,8 @@
if (vo_dwidth > priv->cur_backbuf_width ||
vo_dheight > priv->cur_backbuf_height) {
- change_d3d_backbuffer (BACKBUFFER_RESET);
+ if (!change_d3d_backbuffer (BACKBUFFER_RESET))
+ return 0;
}
/* Destroy the OSD textures. They should always match the new dimensions
@@ -519,7 +520,7 @@
if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device,
&vp))) {
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to set the viewport\n");
- return VO_ERROR;
+ return 0;
}
calc_fs_rect();
More information about the MPlayer-dev-eng
mailing list