Fixes file descriptor leak

If code calls va_isDRI2Connected multiple times there is no protection
against calling open(device_name, O_RDWR) again and losing the reference
to the original file descriptor.

A recent change (bc8a12) calls the method twice each time libva is
initialized, thus causing a leak of device file descriptors.

This change moves the initializing of the fd and auth_type to the
creation of the dri_state and then checks to see if they have already
been initialized. If so, the method va_isDRIConnected returns true
and fills in driver_name.
2 files changed
tree: ec478d2552f024f5d14d81fb9df1d5d30b8db169
  1. build/
  2. doc/
  3. pkgconfig/
  4. va/
  5. .cvsignore
  6. .gitignore
  7. .travis.yml
  8. Android.mk
  9. autogen.sh
  10. configure.ac
  11. CONTRIBUTING.md
  12. COPYING
  13. Makefile.am
  14. meson.build
  15. meson_options.txt
  16. NEWS
  17. README.md
  18. style_unify
README.md

Stories in Ready Build Status Coverity Scan Build Status

Libva Project

Libva is an implementation for VA-API (Video Acceleration API)

VA-API is an open-source library and API specification, which provides access to graphics hardware acceleration capabilities for video processing. It consists of a main library and driver-specific acceleration backends for each supported hardware vendor.

If you would like to contribute to libva, check our Contributing guide.

We also recommend taking a look at the ‘janitorial’ bugs in our list of open issues as these bugs can be solved without an extensive knowledge of libva.

We would love to help you start contributing!

Doxygen files are regularly updated through Github Pages and can be accessed directly through github pages libva

The libva development team can be reached via our mailing list and on IRC in channel ##intel-media on Freenode.

We also use #Slack and host VAAPI Media Slack Team. You can signup by submitting your email address to our Slack Team invite page.

Slack complements our other means of communication. Pick the one that works best for you!