[MPlayer-cvslog] r36428 - trunk/libvo/vo_vdpau.c

reimar subversion at mplayerhq.hu
Wed Aug 21 20:08:37 CEST 2013


Author: reimar
Date: Wed Aug 21 20:08:37 2013
New Revision: 36428

Log:
Avoid reinitializing VDPAU on e.g. simple aspect changes.

This avoids decode error if frames from before the
aspect change are used as reference frames after.
It also reduces the issues when using VDPAU together
with -lavdopts threads=n

Modified:
   trunk/libvo/vo_vdpau.c

Modified: trunk/libvo/vo_vdpau.c
==============================================================================
--- trunk/libvo/vo_vdpau.c	Wed Aug 21 20:08:25 2013	(r36427)
+++ trunk/libvo/vo_vdpau.c	Wed Aug 21 20:08:37 2013	(r36428)
@@ -690,6 +690,15 @@ static int config(uint32_t width, uint32
 #endif
     flip = flags & VOFLAG_FLIPPING;
 
+    if (image_format == format &&
+        vid_width    == width  &&
+        vid_height   == height) {
+        // at most aspect change, avoid reinit
+        vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height,
+                                flags, CopyFromParent, "vdpau", title);
+        resize();
+        return 0;
+    }
     image_format = format;
     vid_width    = width;
     vid_height   = height;
@@ -1118,6 +1127,9 @@ static uint32_t get_image(mp_image_t *mp
 static int query_format(uint32_t format)
 {
     int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD | VFCAP_EOSD | VFCAP_EOSD_UNSCALED | VFCAP_FLIP;
+    // if we are already using it we obviously support it
+    if (format == image_format && decoder != VDP_INVALID_HANDLE)
+        return default_flags;
     switch (format) {
     case IMGFMT_BGRA:
         if (force_mixer)
@@ -1251,6 +1263,9 @@ static const char help_msg[] =
 static int preinit(const char *arg)
 {
     int i;
+    image_format = 0;
+    vid_width    = 0;
+    vid_height   = 0;
 
     deint = 0;
     deint_type = 3;


More information about the MPlayer-cvslog mailing list