Commit ed47119f authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Mauro Carvalho Chehab

V4L/DVB (11713): gspca - ov534: Don't discard the images when no UVC EOF

A new image may start without any UVC EOF in the last packet of the
previous image.
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8dd07ef1
...@@ -867,18 +867,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, ...@@ -867,18 +867,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
/* If PTS or FID has changed, start a new frame. */ /* If PTS or FID has changed, start a new frame. */
if (this_pts != sd->last_pts || this_fid != sd->last_fid) { if (this_pts != sd->last_pts || this_fid != sd->last_fid) {
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, if (gspca_dev->last_packet_type == INTER_PACKET)
NULL, 0); frame = gspca_frame_add(gspca_dev,
LAST_PACKET, frame,
NULL, 0);
sd->last_pts = this_pts; sd->last_pts = this_pts;
sd->last_fid = this_fid; sd->last_fid = this_fid;
} gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
/* Add the data from this payload */
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data + 12, len - 12); data + 12, len - 12);
/* If this packet is marked as EOF, end the frame */ /* If this packet is marked as EOF, end the frame */
if (data[1] & UVC_STREAM_EOF) { } else if (data[1] & UVC_STREAM_EOF) {
sd->last_pts = 0; sd->last_pts = 0;
if (frame->data_end - frame->data != if (frame->data_end - frame->data !=
...@@ -886,11 +884,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, ...@@ -886,11 +884,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
PDEBUG(D_PACK, "short frame"); PDEBUG(D_PACK, "short frame");
goto discard; goto discard;
} }
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
NULL, 0); data + 12, len - 12);
} else {
/* Add the data from this payload */
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data + 12, len - 12);
} }
/* Done this payload */ /* Done this payload */
goto scan_next; goto scan_next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment