aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/sonixb.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-06-27 02:08:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 14:31:10 -0400
commitb192ca983746585e807259414f8d6f58cb28311f (patch)
tree8c95bdcebcf4217e3813d803ecf281af2d431e5f /drivers/media/video/gspca/sonixb.c
parentc6dc725c8e0c3438587e18f918f6da16e7a23539 (diff)
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/sonixb.c')
-rw-r--r--drivers/media/video/gspca/sonixb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 95354a339e3d..4989a2c779e5 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -1251,16 +1251,14 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
1251 if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW) { 1251 if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW) {
1252 /* In raw mode we sometimes get some garbage after the frame 1252 /* In raw mode we sometimes get some garbage after the frame
1253 ignore this */ 1253 ignore this */
1254 struct gspca_frame *frame;
1255 int used; 1254 int used;
1256 int size = cam->cam_mode[gspca_dev->curr_mode].sizeimage; 1255 int size = cam->cam_mode[gspca_dev->curr_mode].sizeimage;
1257 1256
1258 frame = gspca_get_i_frame(gspca_dev); 1257 if (gspca_dev->image == NULL) {
1259 if (frame == NULL) {
1260 gspca_dev->last_packet_type = DISCARD_PACKET; 1258 gspca_dev->last_packet_type = DISCARD_PACKET;
1261 return; 1259 return;
1262 } 1260 }
1263 used = frame->data_end - frame->data; 1261 used = gspca_dev->image_len;
1264 if (used + len > size) 1262 if (used + len > size)
1265 len = size - used; 1263 len = size - used;
1266 } 1264 }