comparison libvo/vo_vdpau.c @ 36444:45e6b96cb2e1

Make handling of query_format more robust.
author reimar
date Sun, 08 Dec 2013 18:29:09 +0000
parents 0d52d44ad7b6
children 5d3f93051de9
comparison
equal deleted inserted replaced
36443:0d52d44ad7b6 36444:45e6b96cb2e1
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 (IMGFMT_IS_VDPAU(image_format) && decoder == VDP_INVALID_HANDLE) {
694 mp_msg(MSGT_VO, MSGL_WARN, "[vdpau] Unexpected reinit, query_format called too often?\n");
695 // force a full reinit, otherwise we might run into issues with
696 // some implementations
697 image_format = 0;
698 }
693 if (image_format == format && 699 if (image_format == format &&
694 vid_width == width && 700 vid_width == width &&
695 vid_height == height) { 701 vid_height == height) {
696 // at most aspect change, avoid reinit 702 // at most aspect change, avoid reinit
697 vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height, 703 vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height,
1145 case IMGFMT_VDPAU_MPEG2: 1151 case IMGFMT_VDPAU_MPEG2:
1146 case IMGFMT_VDPAU_H264: 1152 case IMGFMT_VDPAU_H264:
1147 case IMGFMT_VDPAU_WMV3: 1153 case IMGFMT_VDPAU_WMV3:
1148 case IMGFMT_VDPAU_VC1: 1154 case IMGFMT_VDPAU_VC1:
1149 case IMGFMT_VDPAU_MPEG4: 1155 case IMGFMT_VDPAU_MPEG4:
1150 if (create_vdp_decoder(format, 48, 48, 2)) 1156 // Note: this will break the current decoder
1157 // Not all implementations support safely instantiating
1158 // a second decoder, so this is the "lesser evil"
1159 if (create_vdp_decoder(format, 48, 48, 2)) {
1160 vdp_decoder_destroy(decoder);
1161 decoder = VDP_INVALID_HANDLE;
1162 decoder_max_refs = -1;
1151 return default_flags; 1163 return default_flags;
1164 }
1152 } 1165 }
1153 return 0; 1166 return 0;
1154 } 1167 }
1155 1168
1156 static void DestroyVdpauObjects(void) 1169 static void DestroyVdpauObjects(void)