Eyetoy: Don't send duplicate frames

This commit is contained in:
Florin9doi 2021-05-03 12:15:23 +03:00 committed by lightningterror
parent 02546459ea
commit 2eb6d9a0fb
3 changed files with 4 additions and 1 deletions

View File

@ -502,6 +502,7 @@ namespace usb_eyetoy
if (len < (int)mpeg_buffer.length) if (len < (int)mpeg_buffer.length)
len2 = len; len2 = len;
memcpy(buf, mpeg_buffer.start, len2); memcpy(buf, mpeg_buffer.start, len2);
mpeg_buffer.length = 0;
mpeg_mutex.unlock(); mpeg_mutex.unlock();
return len2; return len2;
}; };

View File

@ -474,6 +474,7 @@ namespace usb_eyetoy
if (len < mpeg_buffer.length) if (len < mpeg_buffer.length)
len2 = len; len2 = len;
memcpy(buf, mpeg_buffer.start, len2); memcpy(buf, mpeg_buffer.start, len2);
mpeg_buffer.length = 0;
mpeg_mutex.unlock(); mpeg_mutex.unlock();
return len2; return len2;
}; };

View File

@ -426,7 +426,8 @@ namespace usb_eyetoy
s->mpeg_frame_size = s->videodev->GetImage(s->mpeg_frame_data, 320 * 240 * 2); s->mpeg_frame_size = s->videodev->GetImage(s->mpeg_frame_data, 320 * 240 * 2);
if (s->mpeg_frame_size == 0) if (s->mpeg_frame_size == 0)
{ {
goto send_packet; p->status = USB_RET_NAK;
break;
} }
uint8_t header[] = { uint8_t header[] = {