Skip to content

Commit

Permalink
[media] v4l2-ctrls: queryctrl shouldn't attempt to replace V4L2_CID_P…
Browse files Browse the repository at this point in the history
…RIVATE_BASE IDs

When queryctrl is called with a V4L2_CID_PRIVATE_BASE control ID, then
currently it is replaced by the real internal ID. This is not according to
the spec so keep the V4L2_CID_PRIVATE_BASE ID in this case.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jan 19, 2011
1 parent c959acf commit 829fb2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/video/v4l2-ctrls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,10 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)

ctrl = ref->ctrl;
memset(qc, 0, sizeof(*qc));
qc->id = ctrl->id;
if (id >= V4L2_CID_PRIVATE_BASE)
qc->id = id;
else
qc->id = ctrl->id;
strlcpy(qc->name, ctrl->name, sizeof(qc->name));
qc->minimum = ctrl->minimum;
qc->maximum = ctrl->maximum;
Expand Down

0 comments on commit 829fb2d

Please sign in to comment.