[Cogl] [PATCH 2/3] cogl-gst: Fix get_caps implementation when no context is set

Robert Bragg robert at sixbynine.org
Thu Jan 30 16:13:02 PST 2014


It also looks good to land to me:

Reviewed-by: Robert Bragg <robert at linux.intel.com>

Thanks,
Robert

On Wed, Jan 29, 2014 at 10:12 AM, Lionel Landwerlin
<llandwerlin at gmail.com> wrote:
> This patch looks good to me.
>
> -
> Lionel
>
>
> On 21/01/14 17:33, Neil Roberts wrote:
>>
>> 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.
>> ---
>>   cogl-gst/cogl-gst-video-sink.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/cogl-gst/cogl-gst-video-sink.c
>> b/cogl-gst/cogl-gst-video-sink.c
>> index 7708f59..9b217d4 100644
>> --- a/cogl-gst/cogl-gst-video-sink.c
>> +++ b/cogl-gst/cogl-gst-video-sink.c
>> @@ -1035,7 +1035,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
>
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl


More information about the Cogl mailing list