Re: [PATCH 2/5] stream_pvr: validate extended v4l2 controls before setting them

Reimar Döffinger <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
On Tue, Feb 02, 2016 at 11:21:34AM -0600, Reza Arbab wrote:
> @@ -1021,6 +1021,35 @@ static void
>  add_v4l2_ext_control (struct v4l2_ext_controls *ctrls, struct pvr_t *pvr,
>                        uint32_t id, int32_t value)
>  {
> +  struct v4l2_query_ext_ctrl qctrl;
> +  struct v4l2_querymenu qmenu;
> +
> +  qctrl.id = id;

Please move the qmenu declaration into the block that uses it.
Also I'd prefer if the whole struct gets initialized,
so it would be better to use designated intializers:
struct v4l2_query_ext_ctrl qctrl = { .id = id; };
(something like that, been stuck in C++ land too long
that lacks this feature)
I see a small concern that it might break some drivers
that simply don't implement the query (correctly).
So maybe at least put the messages at MSGL_V?
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.