Index: webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc |
index 19467ca6513421cbb628fe0f7f35bb9fe77190c8..d4729afba1577eff93a0ab60d87e46c04d51cf7a 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc |
@@ -484,6 +484,8 @@ bool RtpDepacketizerH264::ProcessStapAOrSingleNalu( |
parsed_payload->type.Video.width = sps->width; |
parsed_payload->type.Video.height = sps->height; |
nalu.sps_id = sps->id; |
+ } else { |
+ LOG(LS_WARNING) << "Failed to parse SPS id from SPS slice."; |
} |
parsed_payload->frame_type = kVideoFrameKey; |
break; |
@@ -510,8 +512,12 @@ bool RtpDepacketizerH264::ProcessStapAOrSingleNalu( |
default: { |
rtc::Optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice( |
&payload_data[start_offset], end_offset - start_offset); |
- if (pps_id) |
+ if (pps_id) { |
nalu.pps_id = *pps_id; |
+ } else { |
+ LOG(LS_WARNING) << "Failed to parse PPS id from slice of type: " |
+ << static_cast<int>(nalu.type); |
+ } |
break; |
} |
} |
@@ -547,8 +553,13 @@ bool RtpDepacketizerH264::ParseFuaNalu( |
length_ -= kNalHeaderSize; |
rtc::Optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice( |
payload_data + 2 * kNalHeaderSize, length_ - kNalHeaderSize); |
- if (pps_id) |
+ if (pps_id) { |
nalu.pps_id = *pps_id; |
+ } else { |
+ LOG(LS_WARNING) << "Failed to parse PPS from first fragment of FU-A NAL " |
+ "unit with original type: " |
+ << static_cast<int>(nalu.type); |
+ } |
uint8_t original_nal_header = fnri | original_nal_type; |
modified_buffer_.reset(new rtc::Buffer()); |
modified_buffer_->AppendData(payload_data + kNalHeaderSize, length_); |
@@ -570,8 +581,10 @@ bool RtpDepacketizerH264::ParseFuaNalu( |
RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264; |
h264->packetization_type = kH264FuA; |
h264->nalu_type = original_nal_type; |
- h264->nalus[h264->nalus_length] = nalu; |
- h264->nalus_length = 1; |
+ if (first_fragment) { |
+ h264->nalus[h264->nalus_length] = nalu; |
+ h264->nalus_length = 1; |
+ } |
return true; |
} |