]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (11218): gspca - sq905: Update the frame pointer after adding the last packet.
authorJean-Francois Moine <moinejf@free.fr>
Thu, 26 Mar 2009 08:01:48 +0000 (05:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:41 +0000 (12:43 -0300)
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/sq905.c

index da60eea51e4433b36364eafde7402245a7e72e1b..b1d377e495c2a071188fd82e54c72dfae1ca09d3 100644 (file)
@@ -270,13 +270,14 @@ static void sq905_dostream(struct work_struct *work)
                        }
                        frame = gspca_get_i_frame(gspca_dev);
                        if (frame && !discarding) {
-                               gspca_frame_add(gspca_dev, packet_type,
+                               frame = gspca_frame_add(gspca_dev, packet_type,
                                                frame, data, data_len);
                                /* If entire frame fits in one packet we still
                                   need to add a LAST_PACKET */
-                               if ((packet_type == FIRST_PACKET) &&
-                                   (bytes_left == 0))
-                                       gspca_frame_add(gspca_dev, LAST_PACKET,
+                               if (packet_type == FIRST_PACKET &&
+                                   bytes_left == 0)
+                                       frame = gspca_frame_add(gspca_dev,
+                                                       LAST_PACKET,
                                                        frame, data, 0);
                        } else {
                                discarding = 1;