Index: media/formats/mp4/mp4_stream_parser.cc |
diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc |
index 3136e1931d64435d705316d41f0ac79800cd1814..044f376629994a903d8e83584e2d214999a89937 100644 |
--- a/media/formats/mp4/mp4_stream_parser.cc |
+++ b/media/formats/mp4/mp4_stream_parser.cc |
@@ -365,13 +365,10 @@ bool MP4StreamParser::PrepareAVCBuffer( |
// If this is a keyframe, we (re-)inject SPS and PPS headers at the start of |
// a frame. If subsample info is present, we also update the clear byte |
// count for that first subsample. |
- std::vector<uint8> param_sets; |
- RCHECK(AVC::ConvertConfigToAnnexB(avc_config, ¶m_sets)); |
- frame_buf->insert(frame_buf->begin(), |
- param_sets.begin(), param_sets.end()); |
- if (!subsamples->empty()) |
- (*subsamples)[0].clear_bytes += param_sets.size(); |
+ RCHECK(AVC::InsertParamSetsAnnexB(avc_config, frame_buf, subsamples)); |
} |
+ |
+ DCHECK(AVC::IsValidAnnexB(*frame_buf)); |
return true; |
} |