修复h264/h265 prefixSize计算错误的bug

This commit is contained in:
xiongziliang
2020-05-26 17:00:51 +08:00
parent 7d8dbb2a4b
commit 7b90daab24
4 changed files with 22 additions and 25 deletions

View File

@@ -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([](){