Mercurial > mplayer.hg
comparison libvo/vo_vdpau.c @ 36332:9de70162224b
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
author | reimar |
---|---|
date | Wed, 21 Aug 2013 18:08:37 +0000 |
parents | d649e84ea8d5 |
children | bbf289ad03f2 |
comparison
equal
deleted
inserted
replaced
36331:8aac4a73c0d4 | 36332:9de70162224b |
---|---|
688 #ifdef CONFIG_XF86VM | 688 #ifdef CONFIG_XF86VM |
689 int vm = flags & VOFLAG_MODESWITCHING; | 689 int vm = flags & VOFLAG_MODESWITCHING; |
690 #endif | 690 #endif |
691 flip = flags & VOFLAG_FLIPPING; | 691 flip = flags & VOFLAG_FLIPPING; |
692 | 692 |
693 if (image_format == format && | |
694 vid_width == width && | |
695 vid_height == height) { | |
696 // at most aspect change, avoid reinit | |
697 vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height, | |
698 flags, CopyFromParent, "vdpau", title); | |
699 resize(); | |
700 return 0; | |
701 } | |
693 image_format = format; | 702 image_format = format; |
694 vid_width = width; | 703 vid_width = width; |
695 vid_height = height; | 704 vid_height = height; |
696 free_video_specific(); | 705 free_video_specific(); |
697 if (IMGFMT_IS_VDPAU(image_format) | 706 if (IMGFMT_IS_VDPAU(image_format) |
1116 } | 1125 } |
1117 | 1126 |
1118 static int query_format(uint32_t format) | 1127 static int query_format(uint32_t format) |
1119 { | 1128 { |
1120 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; | 1129 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; |
1130 // if we are already using it we obviously support it | |
1131 if (format == image_format && decoder != VDP_INVALID_HANDLE) | |
1132 return default_flags; | |
1121 switch (format) { | 1133 switch (format) { |
1122 case IMGFMT_BGRA: | 1134 case IMGFMT_BGRA: |
1123 if (force_mixer) | 1135 if (force_mixer) |
1124 return 0; | 1136 return 0; |
1125 case IMGFMT_YV12: | 1137 case IMGFMT_YV12: |
1249 ; | 1261 ; |
1250 | 1262 |
1251 static int preinit(const char *arg) | 1263 static int preinit(const char *arg) |
1252 { | 1264 { |
1253 int i; | 1265 int i; |
1266 image_format = 0; | |
1267 vid_width = 0; | |
1268 vid_height = 0; | |
1254 | 1269 |
1255 deint = 0; | 1270 deint = 0; |
1256 deint_type = 3; | 1271 deint_type = 3; |
1257 deint_counter = 0; | 1272 deint_counter = 0; |
1258 deint_mpi[0] = deint_mpi[1] = NULL; | 1273 deint_mpi[0] = deint_mpi[1] = NULL; |