mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
v4l2object: clear old fds in poll when closing v4l2object
When reopening a v4l2 device, the v4l2object->poll will include some old fds, which was assigned to this device before. If the pipeline opens multiple v4l2 devices, the old fd may been assigned to other v4l2 devices when reopening devices. This will cause the timing of the pipeline become confusing when polling devices, leading functional abnormalities. Therefore, when closing v4l2object, remove the old fds in poll to ensure that the pipeline timing is normal. Signed-off-by: Chao Guo <chao.guo@nxp.com> Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5820>
This commit is contained in:
parent
61d3f5c8e0
commit
2e75b8c8e9
1 changed files with 4 additions and 0 deletions
|
@ -985,6 +985,10 @@ gst_v4l2_object_close (GstV4l2Object * v4l2object)
|
||||||
v4l2object->channel = NULL;
|
v4l2object->channel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* remove old fd from poll */
|
||||||
|
if (v4l2object->poll)
|
||||||
|
gst_poll_remove_fd (v4l2object->poll, &v4l2object->pollfd);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue