提交 fa4376d2 编写于 作者: H Hans de Goede 提交者: Mauro Carvalho Chehab

[media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame

Reset image and image_len to NULL/0 on LAST_PACKET when we're in discard
frame mode, just like we do when not discarding the current frame.

The new se401 driver uses image_len for SOF/EOF detection and thus depends on
this.
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 21144ea6
......@@ -443,8 +443,11 @@ void gspca_frame_add(struct gspca_dev *gspca_dev,
} else {
switch (gspca_dev->last_packet_type) {
case DISCARD_PACKET:
if (packet_type == LAST_PACKET)
if (packet_type == LAST_PACKET) {
gspca_dev->last_packet_type = packet_type;
gspca_dev->image = NULL;
gspca_dev->image_len = 0;
}
return;
case LAST_PACKET:
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册