libv4l2subdev: Allow extra spaces between format strings
PATCH 1/1 libv4l2subdev: Allow extra spaces between format strings
It's possible to pass more than one format string (and entity) to v4l2_subdev_parse_setup_formats(), yet v4l2_subdev_parse_pad_format() does not parse the string until the next non-space character. v4l2_subdev_parse_setup_formats() expects to find a comma right after that leading spaces before the comma to produce an error.
Seek until no spaces are seen.
--- utils/media-ctl/libv4l2subdev.c | 1 + 1 file changed, 1 insertion(+)
utils/media-ctl/libv4l2subdev.c +1 -0
@@ -723,6 +723,7 @@ int v4l2_subdev_parse_setup_formats(struct media_device *media, const char *p)if (ret <0 )return ret; +for (;isspace (*end); end++); p = end +1 ; }while (*end ==',' );
Signature · 1 line
2.1.0.231.g7484e3b
Hi Sakari,
Thank you for the patch.
Quoted 9 lines · On Friday 11 March 2016 22:43:18 Sakari Ailus wrote:
It's possible to pass more than one format string (and entity) to
v4l2_subdev_parse_setup_formats(), yetv4l2_subdev_parse_pad_format()does not parse the string until the next non-space character.v4l2_subdev_parse_setup_formats()expects to find a comma right after that leading spaces before the comma to produce an error.Seek until no spaces are seen.
Signed-off-by Sakari Ailus <[email protected]>
Quoted 15 lines
--- utils/media-ctl/libv4l2subdev.c | 1 + 1 file changed, 1 insertion(+)(quoted diff) +0
-0
b/utils/media-ctl/libv4l2subdev.cindex 1f5fca4..3dcf943 100644utils/media-ctl/libv4l2subdev.c +1
-0@@ -723,6 +723,7 @@ int v4l2_subdev_parse_setup_formats(struct media_device *media, const char *p) if (ret < 0)return ret; +for (;isspace (*end); end++); p = end +1 ; }while (*end ==',' );
Signature · 3 lines
Regards, Laurent Pinchart