surface: fix associate subpicture to not report deassociation errors.

This commit is contained in:
Gwenole Beauchesne 2011-12-14 14:13:58 +01:00
parent bf63fe671f
commit 0634dc768d

View file

@ -648,15 +648,19 @@ gst_vaapi_surface_associate_subpicture(
g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE); g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), FALSE);
g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), FALSE); g_return_val_if_fail(GST_VAAPI_IS_SUBPICTURE(subpicture), FALSE);
if (!gst_vaapi_surface_deassociate_subpicture(surface, subpicture))
return FALSE;
if (!surface->priv->subpictures) { if (!surface->priv->subpictures) {
surface->priv->subpictures = g_ptr_array_new(); surface->priv->subpictures = g_ptr_array_new();
if (!surface->priv->subpictures) if (!surface->priv->subpictures)
return FALSE; return FALSE;
} }
if (g_ptr_array_remove_fast(surface->priv->subpictures, subpicture)) {
success = _gst_vaapi_surface_deassociate_subpicture(surface, subpicture);
g_object_unref(subpicture);
if (!success)
return FALSE;
}
success = _gst_vaapi_surface_associate_subpicture( success = _gst_vaapi_surface_associate_subpicture(
surface, surface,
subpicture, subpicture,