summaryrefslogtreecommitdiffstats
path: root/sys/vdpau
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vdpau')
-rw-r--r--sys/vdpau/gstvdp.c8
-rw-r--r--sys/vdpau/gstvdpdevice.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/vdpau/gstvdp.c b/sys/vdpau/gstvdp.c
index 5c524968..0cafbd68 100644
--- a/sys/vdpau/gstvdp.c
+++ b/sys/vdpau/gstvdp.c
@@ -12,12 +12,14 @@
static gboolean
vdpau_init (GstPlugin * vdpau_plugin)
{
+ /* Before giving these elements a rank again, make sure they pass at
+ * least the generic/states test when there's no device available */
gst_element_register (vdpau_plugin, "vdpaumpegdec",
- GST_RANK_PRIMARY - 1, GST_TYPE_VDP_MPEG_DEC);
+ GST_RANK_NONE, GST_TYPE_VDP_MPEG_DEC);
gst_element_register (vdpau_plugin, "vdpauvideoyuv",
- GST_RANK_PRIMARY, GST_TYPE_VDP_VIDEO_YUV);
+ GST_RANK_NONE, GST_TYPE_VDP_VIDEO_YUV);
gst_element_register (vdpau_plugin, "vdpauyuvvideo",
- GST_RANK_PRIMARY, GST_TYPE_VDP_YUV_VIDEO);
+ GST_RANK_NONE, GST_TYPE_VDP_YUV_VIDEO);
return TRUE;
}
diff --git a/sys/vdpau/gstvdpdevice.c b/sys/vdpau/gstvdpdevice.c
index 4ed1b177..f4eb821d 100644
--- a/sys/vdpau/gstvdpdevice.c
+++ b/sys/vdpau/gstvdpdevice.c
@@ -49,9 +49,16 @@ gst_vdp_device_finalize (GObject * object)
{
GstVdpDevice *device = (GstVdpDevice *) object;
- device->vdp_device_destroy (device->device);
- XCloseDisplay (device->display);
+ if (device->device != VDP_INVALID_HANDLE) {
+ device->vdp_device_destroy (device->device);
+ device->device = VDP_INVALID_HANDLE;
+ }
+ if (device->display) {
+ XCloseDisplay (device->display);
+ device->display = NULL;
+ }
g_free (device->display_name);
+ device->display_name = NULL;
G_OBJECT_CLASS (gst_vdp_device_parent_class)->finalize (object);
}