Add workaround for missing last byte in RTSP message

Sometimes on android devices last byte is missing.
This is link to this bug in Goggle Issue Tracker:
https://issuetracker.google.com/issues/150758736?pli=1
This commit is contained in:
Evgeniy S
2023-03-31 15:09:37 +03:00
committed by Cameron Gutman
parent c8828d586c
commit befc9805ab

View File

@@ -175,6 +175,16 @@ int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
break;
}
else if (startsWith(endCheck, "\n\r") && endCheck[2] == '\0') {
// Previous `if` statement already handle situation when two bytes are missing.
// This is the workaround for the same problem, but for only one byte missing.
// Sometimes on android emulators last byte or two bytes are missing.
// This is link to this bug in Goggle Issue Tracker:
// https://issuetracker.google.com/issues/150758736?pli=1
messageEnded = true;
break;
}
else if (startsWith(endCheck, "\n\r\n")) {
// We've encountered the end of the message - mark it thus
messageEnded = true;