fallback-x.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Index: vdpau-video-0.7.4/src/vdpau_driver.c
  2. ===================================================================
  3. --- vdpau-video-0.7.4.orig/src/vdpau_driver.c
  4. +++ vdpau-video-0.7.4/src/vdpau_driver.c
  5. @@ -174,7 +174,7 @@ vdpau_common_Terminate(vdpau_driver_data
  6. }
  7. vdpau_gate_exit(driver_data);
  8. - if (driver_data->vdp_dpy) {
  9. + if (!driver_data->x_fallback && driver_data->vdp_dpy) {
  10. XCloseDisplay(driver_data->vdp_dpy);
  11. driver_data->vdp_dpy = NULL;
  12. }
  13. @@ -187,9 +187,14 @@ vdpau_common_Initialize(vdpau_driver_dat
  14. /* Create a dedicated X11 display for VDPAU purposes */
  15. const char * const x11_dpy_name = XDisplayString(driver_data->x11_dpy);
  16. driver_data->vdp_dpy = XOpenDisplay(x11_dpy_name);
  17. - if (!driver_data->vdp_dpy)
  18. - return VA_STATUS_ERROR_UNKNOWN;
  19. -
  20. + /* Fallback to existing X11 display */
  21. + driver_data->x_fallback = false;
  22. + if (!driver_data->vdp_dpy) {
  23. + driver_data->x_fallback = true;
  24. + driver_data->vdp_dpy = driver_data->x11_dpy;
  25. + printf("Failed to create dedicated X11 display!\n");
  26. + }
  27. +
  28. VdpStatus vdp_status;
  29. driver_data->vdp_device = VDP_INVALID_HANDLE;
  30. vdp_status = vdp_device_create_x11(
  31. Index: vdpau-video-0.7.4/src/vdpau_driver.h
  32. ===================================================================
  33. --- vdpau-video-0.7.4.orig/src/vdpau_driver.h
  34. +++ vdpau-video-0.7.4/src/vdpau_driver.h
  35. @@ -21,6 +21,7 @@
  36. #ifndef VDPAU_DRIVER_H
  37. #define VDPAU_DRIVER_H
  38. +#include <stdbool.h>
  39. #include <va/va_backend.h>
  40. #include "vaapi_compat.h"
  41. #include "vdpau_gate.h"
  42. @@ -100,6 +101,7 @@ struct vdpau_driver_data {
  43. uint64_t va_display_attrs_mtime[VDPAU_MAX_DISPLAY_ATTRIBUTES];
  44. unsigned int va_display_attrs_count;
  45. char va_vendor[256];
  46. + bool x_fallback;
  47. };
  48. typedef struct object_config *object_config_p;