v4l2videodec: Protect against null pool in _stop

This may happen if the negotiation fails, as we will have never
created the pools.
This commit is contained in:
Nicolas Dufresne 2017-10-07 21:17:53 +00:00 committed by Nicolas Dufresne
parent d5f72418c8
commit 9ad90f3bf2

View file

@ -218,8 +218,10 @@ gst_v4l2_video_enc_stop (GstVideoEncoder * encoder)
gst_v4l2_object_stop (self->v4l2output);
gst_v4l2_object_stop (self->v4l2capture);
gst_v4l2_buffer_pool_flush (self->v4l2output->pool);
gst_v4l2_buffer_pool_flush (self->v4l2capture->pool);
if (self->v4l2output->pool)
gst_v4l2_buffer_pool_flush (self->v4l2output->pool);
if (self->v4l2capture->pool)
gst_v4l2_buffer_pool_flush (self->v4l2capture->pool);
if (self->input_state) {
gst_video_codec_state_unref (self->input_state);