[Cogl] [PATCH 1/2] cogl-gst: prevent crash when renderer is not ready

Lionel Landwerlin llandwerlin at gmail.com
Tue Jul 9 06:08:03 PDT 2013


---
 cogl-gst/cogl-gst-video-sink.c | 3 +++
 cogl-gst/cogl-gst-video-sink.h | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index 22326e5..88fbb51 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -381,6 +381,9 @@ cogl_gst_video_sink_get_pipeline (CoglGstVideoSink *vt)
 
   priv = vt->priv;
 
+  if (priv->renderer == NULL)
+    return NULL;
+
   if (priv->pipeline == NULL)
     {
       priv->pipeline = cogl_pipeline_new (priv->ctx);
diff --git a/cogl-gst/cogl-gst-video-sink.h b/cogl-gst/cogl-gst-video-sink.h
index 45ed835..67130a9 100644
--- a/cogl-gst/cogl-gst-video-sink.h
+++ b/cogl-gst/cogl-gst-video-sink.h
@@ -208,7 +208,8 @@ cogl_gst_video_sink_new (CoglContext *ctx);
  * Note: it is considered an error to call this function before the
  * #CoglGstVideoSink::pipeline-ready signal is emitted.
  *
- * Return value: the pipeline for rendering the current frame
+ * Return value: the pipeline for rendering the current frame or
+ *   #NULL if the "pipeline-ready" hasn't been emitted yet.
  * Since: 1.16
  */
 CoglPipeline *
-- 
1.8.3.2



More information about the Cogl mailing list