summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/surface.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2014-08-13 15:49:18 +0200
committerChristian König <[email protected]>2014-08-14 11:57:07 +0200
commit6fb42ee7a632e181160ac4be234b30e50a1b91d5 (patch)
tree962b6f4da56cdc0d8791f65177a4ce111dc0a966 /src/gallium/state_trackers/vdpau/surface.c
parentc1df492d03862f75698ba5d50d4f46cd528ffc0d (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/surface.c')
-rw-r--r--src/gallium/state_trackers/vdpau/surface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index 0d9f2b0c52c..1932cdd1066 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -74,7 +74,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
goto inv_device;
}
- p_surf->device = dev;
+ DeviceReference(&p_surf->device, dev);
pipe = dev->context;
pipe_mutex_lock(dev->mutex);
@@ -115,6 +115,7 @@ no_handle:
p_surf->video_buffer->destroy(p_surf->video_buffer);
inv_device:
+ DeviceReference(&p_surf->device, NULL);
FREE(p_surf);
no_res:
@@ -140,6 +141,7 @@ vlVdpVideoSurfaceDestroy(VdpVideoSurface surface)
pipe_mutex_unlock(p_surf->device->mutex);
vlRemoveDataHTAB(surface);
+ DeviceReference(&p_surf->device, NULL);
FREE(p_surf);
return VDP_STATUS_OK;