diff options
author | Christian König <[email protected]> | 2014-08-13 15:49:18 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2014-08-14 11:57:07 +0200 |
commit | 6fb42ee7a632e181160ac4be234b30e50a1b91d5 (patch) | |
tree | 962b6f4da56cdc0d8791f65177a4ce111dc0a966 /src/gallium/state_trackers/vdpau/output.c | |
parent | c1df492d03862f75698ba5d50d4f46cd528ffc0d (diff) |
st/vdpau: add device reference counting
This fixes an issue with flash where it tries to destroy a decoder
after already destroying the device associated with the decoder.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82517
Signed-off-by: Christian König <[email protected]>
Acked-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/output.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/output.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c index 457f678a5c7..caae50f37a2 100644 --- a/src/gallium/state_trackers/vdpau/output.c +++ b/src/gallium/state_trackers/vdpau/output.c @@ -69,7 +69,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device, if (!vlsurface) return VDP_STATUS_RESOURCES; - vlsurface->device = dev; + DeviceReference(&vlsurface->device, dev); memset(&res_tmpl, 0, sizeof(res_tmpl)); @@ -120,6 +120,7 @@ err_resource: pipe_resource_reference(&res, NULL); err_unlock: pipe_mutex_unlock(dev->mutex); + DeviceReference(&vlsurface->device, NULL); FREE(vlsurface); return VDP_STATUS_ERROR; } @@ -149,6 +150,7 @@ vlVdpOutputSurfaceDestroy(VdpOutputSurface surface) pipe_mutex_unlock(vlsurface->device->mutex); vlRemoveDataHTAB(surface); + DeviceReference(&vlsurface->device, NULL); FREE(vlsurface); return VDP_STATUS_OK; |