mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 19:51:49 +08:00
修复h264/h265 prefixSize计算错误的bug
This commit is contained in:
@@ -74,6 +74,21 @@ void splitH264(const char *ptr, int len, int prefix, const std::function<void(co
|
||||
}
|
||||
}
|
||||
|
||||
int prefixSize(const char *ptr, int len){
|
||||
if (len < 4) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (memcmp("\x00\x00\x01", ptr, 3) == 0) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (memcmp("\x00\x00\x00\x01", ptr, 4) == 0) {
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
//splitH264函数测试程序
|
||||
static onceToken s_token([](){
|
||||
|
||||
Reference in New Issue
Block a user