diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-14 16:59:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-14 16:59:05 -0400 |
commit | 44e3ff32ac229a10a30b7b840f092f5b32a5f72a (patch) | |
tree | a219aced0374eda136b937b2c3f807464a346d92 /drivers/media/video/ivtv/ivtv-ioctl.c | |
parent | 7a1fa065a0264f6b3d3003ba5635289f6583c478 (diff) | |
parent | e90ff9239e7636a191a8998a70cea220a2c58cdf (diff) |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
V4L/DVB (6220a): fix build error for et61x251 driver
V4L/DVB (6188): Avoid a NULL pointer dereference during mpeg_open()
V4L/DVB (6173a): Documentation: Remove reference to dead "cpia_pp=" boot-time option
V4L/DVB (6148): Fix a warning at saa7191_probe
V4L/DVB (6147): Pwc: Fix a broken debug message
V4L/DVB (6144): Fix mux setup for composite sound on AverTV 307
V4L/DVB (6095): ivtv: fix VIDIOC_G_ENC_INDEX flag handling
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index 5977a79619c2..dfe0aedc60fd 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1099,14 +1099,21 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1099 | 1099 | ||
1100 | case VIDIOC_G_ENC_INDEX: { | 1100 | case VIDIOC_G_ENC_INDEX: { |
1101 | struct v4l2_enc_idx *idx = arg; | 1101 | struct v4l2_enc_idx *idx = arg; |
1102 | struct v4l2_enc_idx_entry *e = idx->entry; | ||
1103 | int entries; | ||
1102 | int i; | 1104 | int i; |
1103 | 1105 | ||
1104 | idx->entries = (itv->pgm_info_write_idx + IVTV_MAX_PGM_INDEX - itv->pgm_info_read_idx) % | 1106 | entries = (itv->pgm_info_write_idx + IVTV_MAX_PGM_INDEX - itv->pgm_info_read_idx) % |
1105 | IVTV_MAX_PGM_INDEX; | 1107 | IVTV_MAX_PGM_INDEX; |
1106 | if (idx->entries > V4L2_ENC_IDX_ENTRIES) | 1108 | if (entries > V4L2_ENC_IDX_ENTRIES) |
1107 | idx->entries = V4L2_ENC_IDX_ENTRIES; | 1109 | entries = V4L2_ENC_IDX_ENTRIES; |
1108 | for (i = 0; i < idx->entries; i++) { | 1110 | idx->entries = 0; |
1109 | idx->entry[i] = itv->pgm_info[(itv->pgm_info_read_idx + i) % IVTV_MAX_PGM_INDEX]; | 1111 | for (i = 0; i < entries; i++) { |
1112 | *e = itv->pgm_info[(itv->pgm_info_read_idx + i) % IVTV_MAX_PGM_INDEX]; | ||
1113 | if ((e->flags & V4L2_ENC_IDX_FRAME_MASK) <= V4L2_ENC_IDX_FRAME_B) { | ||
1114 | idx->entries++; | ||
1115 | e++; | ||
1116 | } | ||
1110 | } | 1117 | } |
1111 | itv->pgm_info_read_idx = (itv->pgm_info_read_idx + idx->entries) % IVTV_MAX_PGM_INDEX; | 1118 | itv->pgm_info_read_idx = (itv->pgm_info_read_idx + idx->entries) % IVTV_MAX_PGM_INDEX; |
1112 | break; | 1119 | break; |