v4l2encoder: Fix negotiation error handling

The subclass negotiated function will call set_format, if that fails the
pool will not be created. We ended up with an assertion.

GStreamer-CRITICAL **: gst_buffer_pool_set_active: assertion 'GST_IS_BUFFER_POOL (pool)' failed
This commit is contained in:
Nicolas Dufresne 2017-07-21 15:40:24 -04:00
parent b3e089d415
commit ef633e28f8

View file

@ -377,17 +377,17 @@ static gboolean
gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder)
{
GstV4l2VideoEnc *self = GST_V4L2_VIDEO_ENC (encoder);
gboolean ret;
ret = GST_VIDEO_ENCODER_CLASS (parent_class)->negotiate (encoder);
if (!GST_VIDEO_ENCODER_CLASS (parent_class)->negotiate (encoder))
return FALSE;
if (!gst_buffer_pool_set_active (GST_BUFFER_POOL (self->v4l2capture->pool),
TRUE)) {
GST_WARNING_OBJECT (self, "Could not activate capture buffer pool.");
ret = FALSE;
return FALSE;
}
return ret;
return TRUE;
}
static GstVideoCodecFrame *