@@ -477,9 +477,7 @@ struct state_gl {
477477 struct dictionary *window_hints;
478478 int use_pbo = -1 ;
479479 int req_monitor_idx = -1 ;
480- #ifdef HWACC_VDPAU
481- struct state_vdpau vdp;
482- #endif
480+ struct state_vdpau *vdp{};
483481 bool vdp_interop = false ;
484482 void * scratchpad{}; // /< scratchpad sized WxHx8
485483
@@ -1179,12 +1177,10 @@ static void gl_reconfigure_screen(struct state_gl *s, struct video_desc desc)
11791177 (desc.width + 3 ) / 4 * 4 , s->dxt_height , 0 ,
11801178 (desc.width + 3 ) / 4 * 4 * s->dxt_height ,
11811179 NULL );
1180+ } else if (desc.color_spec == HW_VDPAU) {
1181+ s->vdp = vdp_init ();
11821182 }
1183- #ifdef HWACC_VDPAU
1184- else if (desc.color_spec == HW_VDPAU) {
1185- s->vdp .init ();
1186- }
1187- #endif
1183+
11881184 glActiveTexture (GL_TEXTURE0 + 0 );
11891185 glBindTexture (GL_TEXTURE_2D, s->texture_display );
11901186 struct pixfmt_config const *cfg = get_pixfmt_config (desc.color_spec );
@@ -1965,12 +1961,12 @@ static void upload_compressed_texture(struct state_gl *s, char *data) {
19651961
19661962static void upload_texture (struct state_gl *s, char *data)
19671963{
1968- #ifdef HWACC_VDPAU
19691964 if (s->current_display_desc .color_spec == HW_VDPAU) {
1970- s->vdp .loadFrame (reinterpret_cast <hw_vdpau_frame *>(data));
1965+ vdp_load_frame (s->vdp ,
1966+ reinterpret_cast <struct hw_vdpau_frame *>(data));
19711967 return ;
19721968 }
1973- # endif
1969+
19741970 if (s->current_display_desc .color_spec == DXT1 || s->current_display_desc .color_spec == DXT1_YUV || s->current_display_desc .color_spec == DXT5) {
19751971 upload_compressed_texture (s, data);
19761972 return ;
@@ -2226,6 +2222,7 @@ static void display_gl_done(void *state)
22262222 glfwTerminate ();
22272223
22282224 module_done (&s->mod );
2225+ vdp_destroy (s->vdp );
22292226
22302227 delete s;
22312228}
0 commit comments