videoencoder: Return not-negotiated if we don't have caps when the first buffer arrives

Otherwise things like filesrc ! jpegenc ! fakesink just crash with
a segmentation fault because subclasses expect caps to be there.
This commit is contained in:
Sebastian Dröge 2013-12-05 11:25:47 +01:00
parent 6e639b73ff
commit 820d7d7798

View file

@ -1260,6 +1260,9 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
encoder->priv->do_caps = FALSE; encoder->priv->do_caps = FALSE;
} }
if (!encoder->priv->input_state)
goto not_negotiated;
GST_VIDEO_ENCODER_STREAM_LOCK (encoder); GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
pts = GST_BUFFER_PTS (buf); pts = GST_BUFFER_PTS (buf);