diff options
Diffstat (limited to 'drivers/media/video/gspca/finepix.c')
-rw-r--r-- | drivers/media/video/gspca/finepix.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/media/video/gspca/finepix.c b/drivers/media/video/gspca/finepix.c index 480ec5c87d0e..5d90e7448579 100644 --- a/drivers/media/video/gspca/finepix.c +++ b/drivers/media/video/gspca/finepix.c | |||
@@ -82,7 +82,6 @@ static void dostream(struct work_struct *work) | |||
82 | struct gspca_dev *gspca_dev = &dev->gspca_dev; | 82 | struct gspca_dev *gspca_dev = &dev->gspca_dev; |
83 | struct urb *urb = gspca_dev->urb[0]; | 83 | struct urb *urb = gspca_dev->urb[0]; |
84 | u8 *data = urb->transfer_buffer; | 84 | u8 *data = urb->transfer_buffer; |
85 | struct gspca_frame *frame; | ||
86 | int ret = 0; | 85 | int ret = 0; |
87 | int len; | 86 | int len; |
88 | 87 | ||
@@ -118,10 +117,6 @@ again: | |||
118 | } | 117 | } |
119 | if (!gspca_dev->present || !gspca_dev->streaming) | 118 | if (!gspca_dev->present || !gspca_dev->streaming) |
120 | goto out; | 119 | goto out; |
121 | frame = gspca_get_i_frame(&dev->gspca_dev); | ||
122 | if (frame == NULL) | ||
123 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
124 | |||
125 | if (len < FPIX_MAX_TRANSFER || | 120 | if (len < FPIX_MAX_TRANSFER || |
126 | (data[len - 2] == 0xff && | 121 | (data[len - 2] == 0xff && |
127 | data[len - 1] == 0xd9)) { | 122 | data[len - 1] == 0xd9)) { |
@@ -132,21 +127,17 @@ again: | |||
132 | * but there's nothing we can do. We also end | 127 | * but there's nothing we can do. We also end |
133 | * here if the the jpeg ends right at the end | 128 | * here if the the jpeg ends right at the end |
134 | * of the frame. */ | 129 | * of the frame. */ |
135 | if (frame) | 130 | gspca_frame_add(gspca_dev, LAST_PACKET, |
136 | frame = gspca_frame_add(gspca_dev, | 131 | data, len); |
137 | LAST_PACKET, | ||
138 | frame, | ||
139 | data, len); | ||
140 | break; | 132 | break; |
141 | } | 133 | } |
142 | 134 | ||
143 | /* got a partial image */ | 135 | /* got a partial image */ |
144 | if (frame) | 136 | gspca_frame_add(gspca_dev, |
145 | gspca_frame_add(gspca_dev, | 137 | gspca_dev->last_packet_type |
146 | gspca_dev->last_packet_type | 138 | == LAST_PACKET |
147 | == LAST_PACKET | 139 | ? FIRST_PACKET : INTER_PACKET, |
148 | ? FIRST_PACKET : INTER_PACKET, | 140 | data, len); |
149 | frame, data, len); | ||
150 | } | 141 | } |
151 | 142 | ||
152 | /* We must wait before trying reading the next | 143 | /* We must wait before trying reading the next |