[Libva] [PATCH] xvba-va-driver: call XDisplayClose in vaTerminate
Rinat Ibragimov
ibragimovrinat at mail.ru
Fri Apr 19 05:04:55 PDT 2013
Hi.
Don't know where to report xvba-va-driver issue I faced. Hope it's ok
to do it here.
With xvba-va-driver the following code fails to do all 1000 iterations.
Inside vaInitialize xvba-va-driver opens connection to X server with
XOpenDisplay, but never closes it. So after around 200 iterations
vaInitialize returns an error.
=== cut 1 ===
#include <va/va.h>
#include <va/va_x11.h>
#include <va/va_glx.h>
#include <assert.h>
#include <stdio.h>
int main(void)
{
int vmajor, vminor;
Display *dpy;
VADisplay va_dpy;
dpy = XOpenDisplay(NULL);
assert(dpy);
for (int k = 0; k < 1000; k ++) {
printf("k = %d\n", k);
va_dpy = vaGetDisplay(dpy);
VAStatus status = vaInitialize(va_dpy, &vmajor, &vminor);
if (VA_STATUS_SUCCESS != status)
return 1;
vaTerminate(va_dpy);
}
XCloseDisplay(dpy);
}
=== cut 1 ===
This patch solves problem for me.
=== cut 2 ===
diff -ur xvba-video-0.8.0/src/xvba_driver.c xvba-video-0.8.0-n/src/xvba_driver.c
--- xvba-video-0.8.0/src/xvba_driver.c 2011-06-14 15:07:13.000000000 +0400
+++ xvba-video-0.8.0-n/src/xvba_driver.c 2013-04-19 15:28:00.000000000 +0400
@@ -125,6 +125,8 @@
}
xvba_gate_exit();
+ if (driver_data->x11_dpy_local)
+ XCloseDisplay(driver_data->x11_dpy_local);
}
// vaInitialize
=== cut 2 ===
---
Rinat
More information about the Libva
mailing list