summaryrefslogtreecommitdiff
path: root/drivers/media/video/gspca/vc032x.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-06-27 10:08:19 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 22:31:10 +0400
commitb192ca983746585e807259414f8d6f58cb28311f (patch)
tree8c95bdcebcf4217e3813d803ecf281af2d431e5f /drivers/media/video/gspca/vc032x.c
parentc6dc725c8e0c3438587e18f918f6da16e7a23539 (diff)
downloadlinux-b192ca983746585e807259414f8d6f58cb28311f.tar.xz
V4L/DVB: gspca - main: Simplify image building
The image pointer and its length are now in the main structure instead of in the frame buffer. They are updated on application vidioc_qbuf and in the URB interrupt function when ending an image. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/vc032x.c')
-rw-r--r--drivers/media/video/gspca/vc032x.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 732c3dfe46ff..0a7d1e0866d2 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -3726,17 +3726,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* The vc0321 sends some additional data after sending the complete
* frame, we ignore this. */
if (sd->bridge == BRIDGE_VC0321) {
- struct gspca_frame *frame;
- int l;
+ int size, l;
- frame = gspca_get_i_frame(gspca_dev);
- if (frame == NULL) {
+ if (gspca_dev->image == NULL) {
gspca_dev->last_packet_type = DISCARD_PACKET;
return;
}
- l = frame->data_end - frame->data;
- if (len > frame->v4l2_buf.length - l)
- len = frame->v4l2_buf.length - l;
+ l = gspca_dev->image_len;
+ size = gspca_dev->frsz;
+ if (len > size - l)
+ len = size - l;
}
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}