v4l2allocator: Don't do REQBUFS(0) on inactive allocator

If the allocator is no longer active, it means the memory has already
been freed, calling REQBUF(0) would make no sense.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/649>
This commit is contained in:
Nicolas Dufresne 2020-06-26 13:10:00 -04:00 committed by GStreamer Merge Bot
parent b8f1f2195e
commit 93b202b84e

View file

@ -812,6 +812,9 @@ gst_v4l2_allocator_orphan (GstV4l2Allocator * allocator)
GST_OBJECT_FLAG_SET (allocator, GST_V4L2_ALLOCATOR_FLAG_ORPHANED);
if (!g_atomic_int_get (&allocator->active))
return TRUE;
if (obj->ioctl (obj->video_fd, VIDIOC_REQBUFS, &breq) < 0) {
GST_ERROR_OBJECT (allocator,
"error orphaning buffers buffers: %s", g_strerror (errno));