aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 5325c7aacaf3..84507a39f2b8 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -622,6 +622,7 @@ static int cx18_encoder_cmd(struct file *file, void *fh,
622{ 622{
623 struct cx18_open_id *id = fh; 623 struct cx18_open_id *id = fh;
624 struct cx18 *cx = id->cx; 624 struct cx18 *cx = id->cx;
625 u32 h;
625 626
626 switch (enc->cmd) { 627 switch (enc->cmd) {
627 case V4L2_ENC_CMD_START: 628 case V4L2_ENC_CMD_START:
@@ -643,8 +644,14 @@ static int cx18_encoder_cmd(struct file *file, void *fh,
643 return -EPERM; 644 return -EPERM;
644 if (test_and_set_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags)) 645 if (test_and_set_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags))
645 return 0; 646 return 0;
647 h = cx18_find_handle(cx);
648 if (h == CX18_INVALID_TASK_HANDLE) {
649 CX18_ERR("Can't find valid task handle for "
650 "V4L2_ENC_CMD_PAUSE\n");
651 return -EBADFD;
652 }
646 cx18_mute(cx); 653 cx18_mute(cx);
647 cx18_vapi(cx, CX18_CPU_CAPTURE_PAUSE, 1, cx18_find_handle(cx)); 654 cx18_vapi(cx, CX18_CPU_CAPTURE_PAUSE, 1, h);
648 break; 655 break;
649 656
650 case V4L2_ENC_CMD_RESUME: 657 case V4L2_ENC_CMD_RESUME:
@@ -654,7 +661,13 @@ static int cx18_encoder_cmd(struct file *file, void *fh,
654 return -EPERM; 661 return -EPERM;
655 if (!test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags)) 662 if (!test_and_clear_bit(CX18_F_I_ENC_PAUSED, &cx->i_flags))
656 return 0; 663 return 0;
657 cx18_vapi(cx, CX18_CPU_CAPTURE_RESUME, 1, cx18_find_handle(cx)); 664 h = cx18_find_handle(cx);
665 if (h == CX18_INVALID_TASK_HANDLE) {
666 CX18_ERR("Can't find valid task handle for "
667 "V4L2_ENC_CMD_RESUME\n");
668 return -EBADFD;
669 }
670 cx18_vapi(cx, CX18_CPU_CAPTURE_RESUME, 1, h);
658 cx18_unmute(cx); 671 cx18_unmute(cx);
659 break; 672 break;
660 673