From 8991e5761440c771e29b9f378b49b2d40db19566 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 10 May 2003 17:37:27 +0000 Subject: [PATCH] fixes #112711 Original commit message from CVS: fixes #112711 --- gst/videotestsrc/gstvideotestsrc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 7bb87d151f..25de924424 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -269,7 +269,8 @@ gst_videotestsrc_getcaps (GstPad * pad, GstCaps * caps) "height",GST_PROPS_INT_RANGE(16,4096)); } - return gst_caps_intersect(caps1,caps2); + /* ref intersection and return it */ + return gst_caps_ref (gst_caps_intersect(caps1,caps2)); } static void @@ -318,6 +319,12 @@ gst_videotestsrc_get (GstPad * pad) buf = NULL; if (videotestsrc->pool) { buf = gst_buffer_new_from_pool (videotestsrc->pool, 0, 0); + /* if the buffer we get is too small, make our own */ + if (GST_BUFFER_SIZE (buf) < newsize) + { + gst_buffer_unref (buf); + buf = NULL; + } } if (!buf) { buf = gst_buffer_new (); -- 2.34.1