summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2014-01-21 17:33:57 +0000
committerNeil Roberts <neil@linux.intel.com>2014-01-31 12:42:03 +0000
commitb898333181e284164516e7171a14c5ca04773dd5 (patch)
tree02aba1757a84aceddb0e682df036914f97f9aeb3
parent23044a1047162a9f103689b8c6fac6ff0e45e62f (diff)
downloadcogl-b898333181e284164516e7171a14c5ca04773dd5.tar.gz
cogl-gst: Fix get_caps implementation when no context is set
If no context is set on the CoglGstVideoSink then it would previously call gst_caps_ref with a NULL pointer. This patch makes it just return NULL instead. I think that is a valid thing to do because that is what gst_base_sink_default_get_caps does. If we don't do this then it's not possible to use CoglGstVideoSink with GstParse because that tries to link the pipeline after parsing the string. That was previously causing a critical error because the freshly parsed sink doesn't have a CoglContext. Reviewed-by: Robert Bragg <robert@linux.intel.com> Reviewed-by: Lionel Landwerlin <llandwerlin@gmail.com> (cherry picked from commit cf26da2964e372c9fe5bd6da060a57006a83af38)
-rw-r--r--cogl-gst/cogl-gst-video-sink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index 7e896360..31891ea2 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -1126,7 +1126,11 @@ cogl_gst_video_sink_get_caps (GstBaseSink *bsink,
{
CoglGstVideoSink *sink;
sink = COGL_GST_VIDEO_SINK (bsink);
- return gst_caps_ref (sink->priv->caps);
+
+ if (sink->priv->caps == NULL)
+ return NULL;
+ else
+ return gst_caps_ref (sink->priv->caps);
}
static CoglBool