1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 10:02:17 +00:00

build/vdpau: drop support for dynamic loading of libvdpau

After a recent library update on my system MPlayer started crashing on
exit in XCloseDisplay() if -vo vdpau had been used. With normal
linking it works OK. Since there should be little need for the dynamic
loading functionality any more, I'll just drop it rather than try
investigating the exact problem with dynamic loading and whether it
would be fixable. VDPAU is now linked normally with -lvdpau if
available.
This commit is contained in:
Uoti Urpala 2010-02-26 18:37:19 +02:00
parent 5ff421bf5d
commit 74ffb51f33
2 changed files with 7 additions and 28 deletions

7
configure vendored
View File

@ -4314,13 +4314,16 @@ if test "$_vdpau" = auto ; then
if test "$_dl" = yes ; then
cat > $TMPC <<EOF
#include <vdpau/vdpau_x11.h>
int main(void) {return VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE;}
int main(void) {
(void) vdp_device_create_x11(0, 0, 0, 0);
return VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE;}
EOF
cc_check && _vdpau=yes
cc_check -lvdpau && _vdpau=yes
fi
fi
if test "$_vdpau" = yes ; then
def_vdpau='#define CONFIG_VDPAU 1'
libs_mplayer="$libs_mplayer -lvdpau"
_vomodules="vdpau $_vomodules"
else
def_vdpau='#define CONFIG_VDPAU 0'

View File

@ -30,7 +30,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
@ -102,7 +101,6 @@ struct vdpctx {
bool preemption_acked;
bool preemption_user_notified;
unsigned int last_preemption_retry_fail;
VdpDeviceCreateX11 *vdp_device_create;
VdpGetProcAddress *vdp_get_proc_address;
VdpPresentationQueueTarget flip_target;
@ -110,8 +108,6 @@ struct vdpctx {
uint64_t last_vdp_time;
unsigned int last_sync_update;
void *vdpau_lib_handle;
/* output_surfaces[NUM_OUTPUT_SURFACES] is misused for OSD. */
#define osd_surface vc->output_surfaces[NUM_OUTPUT_SURFACES]
VdpOutputSurface output_surfaces[NUM_OUTPUT_SURFACES + 1];
@ -455,7 +451,7 @@ static int win_x11_init_vdpau_procs(struct vo *vo)
{0, -1}
};
vdp_st = vc->vdp_device_create(x11->display, x11->screen,&vc->vdp_device,
vdp_st = vdp_device_create_x11(x11->display, x11->screen,&vc->vdp_device,
&vc->vdp_get_proc_address);
if (vdp_st != VDP_STATUS_OK) {
mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Error when calling "
@ -1579,8 +1575,6 @@ static void uninit(struct vo *vo)
// Free bitstream buffers allocated by FFmpeg
for (int i = 0; i < MAX_VIDEO_SURFACES; i++)
av_freep(&vc->surface_render[i].bitstream_buffers);
dlclose(vc->vdpau_lib_handle);
}
static int preinit(struct vo *vo, const char *arg)
@ -1624,25 +1618,8 @@ static int preinit(struct vo *vo, const char *arg)
if (vc->deint)
vc->deint_type = vc->deint;
char *vdpaulibrary = "libvdpau.so.1";
char *vdpau_device_create = "vdp_device_create_x11";
vc->vdpau_lib_handle = dlopen(vdpaulibrary, RTLD_LAZY);
if (!vc->vdpau_lib_handle) {
mp_msg(MSGT_VO, MSGL_ERR,
"[vdpau] Could not open dynamic library %s\n", vdpaulibrary);
if (!vo_init(vo))
return -1;
}
vc->vdp_device_create = dlsym(vc->vdpau_lib_handle, vdpau_device_create);
if (!vc->vdp_device_create) {
mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Could not find function %s in %s\n",
vdpau_device_create, vdpaulibrary);
dlclose(vc->vdpau_lib_handle);
return -1;
}
if (!vo_init(vo)) {
dlclose(vc->vdpau_lib_handle);
return -1;
}
// After this calling uninit() should work to free resources
@ -1650,7 +1627,6 @@ static int preinit(struct vo *vo, const char *arg)
if (vc->vdp->device_destroy)
vc->vdp->device_destroy(vc->vdp_device);
vo_x11_uninit(vo);
dlclose(vc->vdpau_lib_handle);
return -1;
}