@@ -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
@@ -1180,12 +1178,10 @@ static void gl_reconfigure_screen(struct state_gl *s, struct video_desc desc)
11801178 (desc.width + 3 ) / 4 * 4 , s->dxt_height , 0 ,
11811179 (desc.width + 3 ) / 4 * 4 * s->dxt_height ,
11821180 NULL );
1181+ } else if (desc.color_spec == HW_VDPAU) {
1182+ s->vdp = vdp_init ();
11831183 }
1184- #ifdef HWACC_VDPAU
1185- else if (desc.color_spec == HW_VDPAU) {
1186- s->vdp .init ();
1187- }
1188- #endif
1184+
11891185 glActiveTexture (GL_TEXTURE0 + 0 );
11901186 glBindTexture (GL_TEXTURE_2D, s->texture_display );
11911187 struct pixfmt_config const *cfg = get_pixfmt_config (desc.color_spec );
@@ -1966,12 +1962,12 @@ static void upload_compressed_texture(struct state_gl *s, char *data) {
19661962
19671963static void upload_texture (struct state_gl *s, char *data)
19681964{
1969- #ifdef HWACC_VDPAU
19701965 if (s->current_display_desc .color_spec == HW_VDPAU) {
1971- s->vdp .loadFrame (reinterpret_cast <hw_vdpau_frame *>(data));
1966+ vdp_load_frame (s->vdp ,
1967+ reinterpret_cast <struct hw_vdpau_frame *>(data));
19721968 return ;
19731969 }
1974- # endif
1970+
19751971 if (s->current_display_desc .color_spec == DXT1 || s->current_display_desc .color_spec == DXT1_YUV || s->current_display_desc .color_spec == DXT5) {
19761972 upload_compressed_texture (s, data);
19771973 return ;
@@ -2227,6 +2223,7 @@ static void display_gl_done(void *state)
22272223 glfwTerminate ();
22282224
22292225 module_done (&s->mod );
2226+ vdp_destroy (s->vdp );
22302227
22312228 delete s;
22322229}
0 commit comments