]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/direct3d.c
Check malloc return value when needed and don't print an error when such error happend.
[vlc] / modules / video_output / msw / direct3d.c
index 93919171c1c4dddfc87272b09933671d9fcb9bc4..19c8efc133c4a03bfd5c4f000f910279db567d56 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 
 #include <vlc/vlc.h>
+#include <vlc_plugin.h>
 #include <vlc_interface.h>
 #include <vlc_playlist.h>
 #include <vlc_vout.h>
@@ -108,7 +109,7 @@ vlc_module_begin();
     set_shortname( "Direct3D" );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VOUT );
-    set_description( _("DirectX 3D video output") );
+    set_description( N_("DirectX 3D video output") );
     set_capability( "video output", get_capability_for_osversion() );
     add_shortcut( "direct3d" );
     set_callbacks( OpenVideo, CloseVideo );
@@ -152,10 +153,7 @@ static int OpenVideo( vlc_object_t *p_this )
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
-    {
-        msg_Err( p_vout, "out of memory" );
         return VLC_ENOMEM;
-    }
     memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
     if( VLC_SUCCESS != Direct3DVoutCreate( p_vout ) )
@@ -174,7 +172,7 @@ static int OpenVideo( vlc_object_t *p_this )
     p_vout->p_sys->hwnd = p_vout->p_sys->hvideownd = NULL;
     p_vout->p_sys->hparent = p_vout->p_sys->hfswnd = NULL;
     p_vout->p_sys->i_changes = 0;
-    vlc_mutex_init( p_vout, &p_vout->p_sys->lock );
+    vlc_mutex_init( &p_vout->p_sys->lock );
     SetRectEmpty( &p_vout->p_sys->rect_display );
     SetRectEmpty( &p_vout->p_sys->rect_parent );
 
@@ -205,7 +203,7 @@ static int OpenVideo( vlc_object_t *p_this )
         vlc_object_create( p_vout, sizeof(event_thread_t) );
     p_vout->p_sys->p_event->p_vout = p_vout;
     if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
-                           E_(EventThread), 0, 1 ) )
+                           EventThread, 0, 1 ) )
     {
         msg_Err( p_vout, "cannot create Vout EventThread" );
         vlc_object_release( p_vout->p_sys->p_event );
@@ -335,7 +333,7 @@ static int Init( vout_thread_t *p_vout )
     p_vout->output.i_height = p_vout->render.i_height;
     p_vout->output.i_aspect = p_vout->render.i_aspect;
     p_vout->fmt_out = p_vout->fmt_in;
-    E_(UpdateRects)( p_vout, true );
+    UpdateRects( p_vout, true );
 
     /*  create picture pool */
     p_vout->output.i_chroma = 0;
@@ -453,7 +451,7 @@ static int Manage( vout_thread_t *p_vout )
         p_vout->fmt_out.i_sar_num = p_vout->fmt_in.i_sar_num;
         p_vout->fmt_out.i_sar_den = p_vout->fmt_in.i_sar_den;
         p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
-        E_(UpdateRects)( p_vout, true );
+        UpdateRects( p_vout, true );
     }
 
     /* We used to call the Win32 PeekMessage function here to read the window
@@ -1379,8 +1377,8 @@ static void Direct3DVoutRenderScene( vout_thread_t *p_vout, picture_t *p_pic )
     }
 
     /* Setup vertices */
-    f_width  = (float)(p_vout->output.i_width);
-    f_height = (float)(p_vout->output.i_height);
+    f_width  = (float)(p_vout->output.i_width) + 1;
+    f_height = (float)(p_vout->output.i_height) + 1;
 
     p_vertices[0].x       = 0.0f;       // left
     p_vertices[0].y       = 0.0f;       // top