Skip to content

Commit

Permalink
Fix h264 keyframe parse error (#1405)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchao0310 authored and jcague committed May 14, 2019
1 parent d391121 commit 12b279b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion erizo/src/erizo/rtp/RtpH264Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int RtpH264Parser::parse_packet_fu_a(RTPPayloadH264* h264, unsigned char* buf, i
buf += 2;
len -= 2;

if (nal_type == 5) {
if (nal_type == 5 && start_bit == 1) {
h264->frameType = kH264IFrame;
}

Expand Down Expand Up @@ -145,6 +145,10 @@ int RtpH264Parser::parse_aggregated_packet(RTPPayloadH264* h264, unsigned char*
dst += sizeof(RTPPayloadH264::start_sequence);
std::memcpy(dst, src, nal_size);
dst += nal_size;
uint8_t nal_type = src[0] & 0x1f;
if (nal_type == 5) {
h264->frameType = kH264IFrame;
}
}
} else {
ELOG_ERROR("NAL size exceeds length: %d %d\n", nal_size, src_len);
Expand Down

0 comments on commit 12b279b

Please sign in to comment.