diff options
author | gb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969> | 2010-03-23 10:48:58 +0000 |
---|---|---|
committer | gb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969> | 2010-03-23 10:48:58 +0000 |
commit | b3c3554938618357ef99165d00eeed252be5ceca (patch) | |
tree | 6ee62b4bbcd9536f74d22f4eb085eec8c7c6eb6f /tests/test-windows.c | |
parent | 6a8c6ad04c6f25ed2a5470c5e5b526c83d37503a (diff) |
Unref subpicture earlier as the surface is supposed to hold a reference to it.
Diffstat (limited to 'tests/test-windows.c')
-rw-r--r-- | tests/test-windows.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-windows.c b/tests/test-windows.c index cea4d187..bca4afca 100644 --- a/tests/test-windows.c +++ b/tests/test-windows.c @@ -265,7 +265,7 @@ main(int argc, char *argv[]) GstVaapiWindow *window; GstVaapiSurface *surface; GstVaapiImage *image = NULL; - GstVaapiSubpicture *subpicture = NULL; + GstVaapiSubpicture *subpicture; GstVaapiImageFormat format; guint flags = GST_VAAPI_PICTURE_STRUCTURE_FRAME; guint i; @@ -318,6 +318,9 @@ main(int argc, char *argv[]) if (!gst_vaapi_surface_associate_subpicture(surface, subpicture, NULL, NULL)) g_error("could not associate subpicture to surface"); + + /* The surface holds a reference to the subpicture. This is safe. */ + g_object_unref(subpicture); } else { if (!gst_vaapi_surface_put_image(surface, image)) @@ -383,8 +386,6 @@ main(int argc, char *argv[]) XDestroyWindow(dpy, win); } - if (subpicture) - g_object_unref(subpicture); g_object_unref(image); g_object_unref(surface); g_object_unref(display); |