关于PAT中的section_length
Closed this issue · 0 comments
RocFang commented
HI, @js2854 ,
您好,首先谢谢你的这个项目:)
在读解析PAT的__ParsePAT函数时,有个疑惑:
根据标准,PAT中的section_length的定义是:
This is a twelve bit field, the first two bits of which shall be '00'. It specifies the number
of bytes of the section, starting immediately following the section_length field, and including the CRC.
The value in this field shall not exceed 1021
即,section_length表示的长度是从PAT中的section_length下一个字段即transport_stream_id开始到尾部CRC之间的长度,而不包含section_length及之前一共3个字节的长度,而__ParsePAT函数的代码段:
uint16 u16AllSubSectionLen = u16SectionLen - sizeof(PATHdrFixedPart) - CRC32_LEN;
这行代码认为subsection的长度是section_length减去整个头部的长度和CRC的长度,是否多减了三个字节?