Lines 117-141
Link Here
|
117 |
vdpau_driver = "nvidia"; |
117 |
vdpau_driver = "nvidia"; |
118 |
} |
118 |
} |
119 |
|
119 |
|
|
|
120 |
_vdp_driver_dll = NULL; |
120 |
if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib), DRIVER_LIB_FORMAT, |
121 |
if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib), DRIVER_LIB_FORMAT, |
121 |
VDPAU_MODULEDIR "/", vdpau_driver, ".1") >= |
122 |
VDPAU_MODULEDIR "/", vdpau_driver, ".1") >= |
122 |
sizeof(vdpau_driver_lib)) { |
123 |
sizeof(vdpau_driver_lib)) { |
123 |
fprintf(stderr, "Failed to construct driver path: path too long\n"); |
124 |
fprintf(stderr, "Failed to construct driver path: path too long\n"); |
124 |
if (vdpau_driver_dri2) { |
125 |
} else { |
125 |
XFree(vdpau_driver_dri2); |
126 |
_vdp_driver_dll = dlopen(vdpau_driver_lib, RTLD_NOW | RTLD_GLOBAL); |
126 |
vdpau_driver_dri2 = NULL; |
|
|
127 |
} |
128 |
_VDP_ERROR_BREAKPOINT(); |
129 |
return VDP_STATUS_NO_IMPLEMENTATION; |
130 |
} |
127 |
} |
131 |
|
128 |
|
132 |
_vdp_driver_dll = dlopen(vdpau_driver_lib, RTLD_NOW | RTLD_GLOBAL); |
|
|
133 |
if (!_vdp_driver_dll) { |
129 |
if (!_vdp_driver_dll) { |
134 |
/* Try again using the old path, which is guaranteed to fit in PATH_MAX |
130 |
/* Try again using the old path. */ |
135 |
* if the complete path fit above. */ |
131 |
if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib), DRIVER_LIB_FORMAT, |
136 |
snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib), DRIVER_LIB_FORMAT, |
132 |
"", vdpau_driver, "") >= sizeof(vdpau_driver_lib)) { |
137 |
"", vdpau_driver, ""); |
133 |
fprintf(stderr, "Failed to construct driver path: path too long\n"); |
138 |
_vdp_driver_dll = dlopen(vdpau_driver_lib, RTLD_NOW | RTLD_GLOBAL); |
134 |
} else { |
|
|
135 |
_vdp_driver_dll = dlopen(vdpau_driver_lib, RTLD_NOW | RTLD_GLOBAL); |
136 |
} |
139 |
} |
137 |
} |
140 |
|
138 |
|
141 |
if (vdpau_driver_dri2) { |
139 |
if (vdpau_driver_dri2) { |