[mythtv-commits] [MythTV/mythtv] a710fa: MythVDPAUInterop: Minor cleanup

Mark Kendall noreply at github.com
Wed Oct 9 15:44:03 UTC 2019


  Branch: refs/heads/devel/2019-render
  Home:   https://github.com/MythTV/mythtv
  Commit: a710fa64e5b00357bab9a28a7d17a0d9da0000da
      https://github.com/MythTV/mythtv/commit/a710fa64e5b00357bab9a28a7d17a0d9da0000da
  Author: Mark Kendall <mark.kendall at gmail.com>
  Date:   2019-10-09 (Wed, 09 Oct 2019)

  Changed paths:
    M mythtv/libs/libmythtv/mythopenglinterop.cpp
    M mythtv/libs/libmythtv/mythvdpauinterop.cpp

  Log Message:
  -----------
  MythVDPAUInterop: Minor cleanup


  Commit: c4db49a3873a7d980a7e5866f42016e81a50f191
      https://github.com/MythTV/mythtv/commit/c4db49a3873a7d980a7e5866f42016e81a50f191
  Author: Mark Kendall <mark.kendall at gmail.com>
  Date:   2019-10-09 (Wed, 09 Oct 2019)

  Changed paths:
    M mythtv/libs/libmythtv/decoders/mythcodeccontext.cpp
    M mythtv/libs/libmythtv/decoders/mythcodeccontext.h
    M mythtv/libs/libmythtv/mythnvdeccontext.cpp
    M mythtv/libs/libmythtv/mythnvdecinterop.cpp
    M mythtv/libs/libmythtv/mythopenglinterop.cpp
    M mythtv/libs/libmythtv/mythopenglinterop.h
    M mythtv/libs/libmythtv/mythvaapicontext.cpp
    M mythtv/libs/libmythtv/mythvdpaucontext.cpp
    M mythtv/libs/libmythtv/mythvtbcontext.cpp

  Log Message:
  -----------
  Fix resource leak in VAAPI and VDPAU

- both VAAPI and VDPAU FFmpeg hardware device contexts set the free and
user_opaque members (not documented) when using the default
av_hwdevice_ctx_create functionality
- we override/reset these to track proper desctruction/reference
counting and to access the OpenGL interopability object.
- as a result, VAAPI and VDPAU hardware contexts were not finishing
properly and release their devices.
- this did not manifest with VAAPI as we use our own initialisation for
the bulk of the time but it caused playback errors with VDPAU after a
number of seeks - as there were multiple concurrent (and leaked) VDPAU
devices.
- we now store the default free/user_opaque values in MythOpenGLInterop
and ensure they are called as the last possible operation before
hardware device destruction
- this also requires a default/dummy MythOpenGLInterop implementation
that does not require an OpenGL context but is used to store those
values when checking functionality and/or not direct rendering (i.e.
decode only).
- also fixes a typo that prevented VDPAU decode only from working.


Compare: https://github.com/MythTV/mythtv/compare/372f8be97a9c...c4db49a3873a


More information about the mythtv-commits mailing list