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..38a4c0ae42bf33eb241be2e47e8a3d7b2de058ce 100644 |
--- a/media/formats/mp4/mp4_stream_parser.cc |
+++ b/media/formats/mp4/mp4_stream_parser.cc |
@@ -365,13 +365,13 @@ 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()); |
+ size_t old_size = frame_buf->size(); |
+ RCHECK(AVC::InsertParamSetsAnnexB(avc_config, frame_buf)); |
if (!subsamples->empty()) |
damienv1
2014/04/23 19:07:28
Would be nice if InsertParamSetsAnnexB returns the
acolwell GONE FROM CHROMIUM
2014/04/23 23:06:53
This code was totally broken for the AUD case. Upd
|
- (*subsamples)[0].clear_bytes += param_sets.size(); |
+ (*subsamples)[0].clear_bytes += frame_buf->size() - old_size; |
} |
+ |
+ DCHECK(AVC::IsValidAnnexB(*frame_buf)); |
return true; |
} |