Skip to content

Commit e015b50

Browse files
mchehabgregkh
authored andcommitted
media: em28xx: use a default format if TRY_FMT fails
commit f823ce2 upstream. Follow the V4L2 spec, as warned by v4l2-compliance: warn: v4l2-test-formats.cpp(732): TRY_FMT cannot handle an invalid pixelformat. warn: v4l2-test-formats.cpp(733): This may or may not be a problem. For more information see: warn: v4l2-test-formats.cpp(734): http://www.mail-archive.com/[email protected]/msg56550.html Cc: [email protected] Fixes: bddcf63 ("V4L/DVB (9927): em28xx: use a more standard way to specify video formats") Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2781b86 commit e015b50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/media/usb/em28xx/em28xx-video.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,9 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
14711471

14721472
fmt = format_by_fourcc(f->fmt.pix.pixelformat);
14731473
if (!fmt) {
1474-
em28xx_videodbg("Fourcc format (%08x) invalid.\n",
1475-
f->fmt.pix.pixelformat);
1476-
return -EINVAL;
1474+
fmt = &format[0];
1475+
em28xx_videodbg("Fourcc format (%08x) invalid. Using default (%08x).\n",
1476+
f->fmt.pix.pixelformat, fmt->fourcc);
14771477
}
14781478

14791479
if (dev->board.is_em2800) {

0 commit comments

Comments
 (0)