Fix destruction order of subpictures. They should be destroyed first.

This commit is contained in:
gb 2010-03-24 14:57:33 +00:00
parent 9713d1a950
commit c8ec504343

View file

@ -71,6 +71,12 @@ gst_vaapi_surface_destroy(GstVaapiSurface *surface)
surface_id = GST_VAAPI_OBJECT_ID(surface);
GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id));
if (priv->subpictures) {
g_ptr_array_foreach(priv->subpictures, destroy_subpicture_cb, NULL);
g_ptr_array_free(priv->subpictures, TRUE);
priv->subpictures = NULL;
}
if (surface_id != VA_INVALID_SURFACE) {
GST_VAAPI_DISPLAY_LOCK(display);
status = vaDestroySurfaces(
@ -83,12 +89,6 @@ gst_vaapi_surface_destroy(GstVaapiSurface *surface)
GST_VAAPI_ID_ARGS(surface_id));
GST_VAAPI_OBJECT_ID(surface) = VA_INVALID_SURFACE;
}
if (priv->subpictures) {
g_ptr_array_foreach(priv->subpictures, destroy_subpicture_cb, NULL);
g_ptr_array_free(priv->subpictures, TRUE);
priv->subpictures = NULL;
}
}
static gboolean