Fixed FLV::Tag.offset() return value for non-H264 packets.

This commit is contained in:
Thulinma 2014-03-19 10:16:05 +01:00
parent bdc4b194df
commit 330b9f871d

View file

@ -265,7 +265,11 @@ std::string FLV::Tag::tagType(){
/// Returns the 24-bit offset of this tag. /// Returns the 24-bit offset of this tag.
/// Returns 0 if the tag isn't H264 /// Returns 0 if the tag isn't H264
int FLV::Tag::offset(){ int FLV::Tag::offset(){
if ((data[11] & 0x0F) == 7){
return (((data[13] << 16) + (data[14] << 8) + data[15]) << 8) >> 8; return (((data[13] << 16) + (data[14] << 8) + data[15]) << 8) >> 8;
}else{
return 0;
}
} //offset getter } //offset getter
/// Sets the 24-bit offset of this tag. /// Sets the 24-bit offset of this tag.