[MPlayer-dev-eng] [PATCH]Do not create window if vdpau is going to fail

Carl Eugen Hoyos cehoyos at rainbow.studorg.tuwien.ac.at
Sun Mar 22 16:36:30 CET 2009


Hi!

Attached patch stops mplayer from creating a window if decoding will 
certainly fail anyway.

Please comment, Carl Eugen
-------------- next part --------------
Index: libvo/vo_vdpau.c
===================================================================
--- libvo/vo_vdpau.c	(revision 29032)
+++ libvo/vo_vdpau.c	(working copy)
@@ -534,6 +534,10 @@
 #endif
 
     image_format = format;
+    vid_width    = width;
+    vid_height   = height;
+    if (IMGFMT_IS_VDPAU(image_format) && !create_vdp_decoder(2))
+        return -1;
 
     int_pause = 0;
     visible_buf = 0;
@@ -585,10 +589,6 @@
     if (vdp_flip_queue == VDP_INVALID_HANDLE && win_x11_init_vdpau_flip_queue())
         return -1;
 
-    // video width and height
-    vid_width  = width;
-    vid_height = height;
-
     if (create_vdp_mixer(vdp_chroma_type))
         return -1;
 
@@ -596,9 +596,6 @@
     vid_surface_num = -1;
     resize();
 
-    if (IMGFMT_IS_VDPAU(image_format) && !create_vdp_decoder(2))
-        return -1;
-
     return 0;
 }
 


More information about the MPlayer-dev-eng mailing list