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

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


Ok, will update documentation in a new batch.

Cheers,

-
Lionel

On 09/07/13 13:29, Robert Bragg wrote:
> The current documentation for cogl_gst_video_sink_get_pipeline()
> explicitly states that it's considered "an error to call this function
> before the #CoglGstVideoSink::pipeline-ready signal is emitted." so I
> think we should either tweak this patch to use g_return_val_if_fail()
> or maybe alternatively update the documentation to explain that this
> function returns NULL if the pipeline-ready signal hasn't been
> emitted.
>
> kind regards,
> - Robert
>
>
> On Mon, Jul 8, 2013 at 2:41 PM, Lionel Landwerlin <llandwerlin at gmail.com> wrote:
>> ---
>>   cogl-gst/cogl-gst-video-sink.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> 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);
>> --
>> 1.8.3.2
>>
>> _______________________________________________
>> Cogl mailing list
>> Cogl at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/cogl



More information about the Cogl mailing list