# HG changeset patch # User reimar # Date 1377108517 0 # Node ID 9de70162224b7513f07c460b6e683e41617c84f6 # Parent 8aac4a73c0d494d719a52a516a164d8366c29049 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 diff -r 8aac4a73c0d4 -r 9de70162224b libvo/vo_vdpau.c --- a/libvo/vo_vdpau.c Wed Aug 21 18:08:25 2013 +0000 +++ b/libvo/vo_vdpau.c Wed Aug 21 18:08:37 2013 +0000 @@ -690,6 +690,15 @@ #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 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 int preinit(const char *arg) { int i; + image_format = 0; + vid_width = 0; + vid_height = 0; deint = 0; deint_type = 3;