v4l2: Add protection when set decoder capture fps accroding to output fps
authorHou Qi <qi.hou@nxp.com>
Mon, 9 Aug 2021 02:46:30 +0000 (10:46 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 17 Aug 2021 13:27:28 +0000 (13:27 +0000)
commit0e7a485528617102d45893317f8366e689b96e10
tree6ede5595f38d2b2725056157002255922d1b7cd5
parent9a216d0ffa34d371b1b6e6e48631a4ebd0d7bdc0
v4l2: Add protection when set decoder capture fps accroding to output fps

Some v4l2 drivers don't have the capacity to change framerate. There is
chance to make decoder capture fps to be 0/0 if numerator and denominator
returned by G_PARM ioctl are both 0. It causes critical warning
"passed '0' as denominator for `GstFraction'".

In order to fix this, add protection when set decoder capture fps according
to output fps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1048>
sys/v4l2/gstv4l2object.c