[media] cx18: fix VIDIOC_ENUMINPUT: wrong std value

The std field of v4l2_input is always V4L2_STD_ALL. For tuner inputs
this should be cx->tuner_std.

This fixes a v4l2-compliance failure.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Hans Verkuil
2015-04-02 08:34:30 -03:00
committed by Mauro Carvalho Chehab
parent eaa80c44d6
commit 3a29a4f177
2 changed files with 13 additions and 1 deletions

View File

@@ -514,6 +514,9 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
{
struct cx18_open_id *id = fh2id(fh);
struct cx18 *cx = id->cx;
v4l2_std_id std = V4L2_STD_ALL;
const struct cx18_card_video_input *card_input =
cx->card->video_inputs + inp;
if (inp >= cx->nof_inputs)
return -EINVAL;
@@ -529,6 +532,11 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
cx->active_input = inp;
/* Set the audio input to whatever is appropriate for the input type. */
cx->audio_input = cx->card->video_inputs[inp].audio_index;
if (card_input->video_type == V4L2_INPUT_TYPE_TUNER)
std = cx->tuner_std;
cx->streams[CX18_ENC_STREAM_TYPE_MPG].video_dev.tvnorms = std;
cx->streams[CX18_ENC_STREAM_TYPE_YUV].video_dev.tvnorms = std;
cx->streams[CX18_ENC_STREAM_TYPE_VBI].video_dev.tvnorms = std;
/* prevent others from messing with the streams until
we're finished changing inputs. */