diff options
-rw-r--r-- | drivers/media/video/gspca/ov534.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 92ab92e4c79f..6d9b102be70c 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -867,18 +867,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, | |||
867 | 867 | ||
868 | /* If PTS or FID has changed, start a new frame. */ | 868 | /* If PTS or FID has changed, start a new frame. */ |
869 | if (this_pts != sd->last_pts || this_fid != sd->last_fid) { | 869 | if (this_pts != sd->last_pts || this_fid != sd->last_fid) { |
870 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, | 870 | if (gspca_dev->last_packet_type == INTER_PACKET) |
871 | NULL, 0); | 871 | frame = gspca_frame_add(gspca_dev, |
872 | LAST_PACKET, frame, | ||
873 | NULL, 0); | ||
872 | sd->last_pts = this_pts; | 874 | sd->last_pts = this_pts; |
873 | sd->last_fid = this_fid; | 875 | sd->last_fid = this_fid; |
874 | } | 876 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, |
875 | |||
876 | /* Add the data from this payload */ | ||
877 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, | ||
878 | data + 12, len - 12); | 877 | data + 12, len - 12); |
879 | |||
880 | /* If this packet is marked as EOF, end the frame */ | 878 | /* If this packet is marked as EOF, end the frame */ |
881 | if (data[1] & UVC_STREAM_EOF) { | 879 | } else if (data[1] & UVC_STREAM_EOF) { |
882 | sd->last_pts = 0; | 880 | sd->last_pts = 0; |
883 | 881 | ||
884 | if (frame->data_end - frame->data != | 882 | 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 | PDEBUG(D_PACK, "short frame"); | 884 | PDEBUG(D_PACK, "short frame"); |
887 | goto discard; | 885 | goto discard; |
888 | } | 886 | } |
889 | |||
890 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, | 887 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, |
891 | NULL, 0); | 888 | data + 12, len - 12); |
889 | } else { | ||
890 | |||
891 | /* Add the data from this payload */ | ||
892 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, | ||
893 | data + 12, len - 12); | ||
892 | } | 894 | } |
893 | 895 | ||
896 | |||
894 | /* Done this payload */ | 897 | /* Done this payload */ |
895 | goto scan_next; | 898 | goto scan_next; |
896 | 899 | ||