diff mbox

[7/7,RFC] ivtv: add priority checks for the non-standard commands.

Message ID 3c0e23e743fdd08545613d56229a122d128358ba.1273432986.git.hverkuil@xs4all.nl (mailing list archive)
State RFC
Headers show

Commit Message

Hans Verkuil May 9, 2010, 7:29 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index c532b77..de392a2 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1777,7 +1777,25 @@  static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
 
 static long ivtv_default(struct file *file, void *fh, int cmd, void *arg)
 {
-	struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
+	struct ivtv_open_id *id = fh2id(fh);
+	struct ivtv *itv = id->itv;
+	int ret;
+
+	switch (cmd) {
+	case VIDEO_PLAY:
+	case VIDEO_STOP:
+	case VIDEO_FREEZE:
+	case VIDEO_CONTINUE:
+	case VIDEO_COMMAND:
+	case VIDEO_SELECT_SOURCE:
+	case AUDIO_SET_MUTE:
+	case AUDIO_CHANNEL_SELECT:
+	case AUDIO_BILINGUAL_CHANNEL_SELECT:
+		ret = v4l2_prio_check(&itv->v4l2_dev.prio, id->fh.prio);
+		if (ret)
+			return ret;
+		break;
+	}
 
 	switch (cmd) {
 	case VIDIOC_INT_RESET: {