mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-21 01:13:37 +08:00
提高性能
This commit is contained in:
parent
7b90daab24
commit
53ca43fb7d
@ -79,13 +79,20 @@ int prefixSize(const char *ptr, int len){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (memcmp("\x00\x00\x01", ptr, 3) == 0) {
|
||||
return 3;
|
||||
if (ptr[0] != 0x00 || ptr[1] != 0x00) {
|
||||
//不是0x00 00开头
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (memcmp("\x00\x00\x00\x01", ptr, 4) == 0) {
|
||||
if (ptr[2] == 0x00 && ptr[3] == 0x01) {
|
||||
//是0x00 00 00 01
|
||||
return 4;
|
||||
}
|
||||
|
||||
if (ptr[2] == 0x01) {
|
||||
//是0x00 00 01
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user