Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: media/formats/mp4/mp4_stream_parser.cc

Issue 246853005: Fix SPS/PPS insertion logic in MP4StreamParser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a bunch of tests Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp4/avc_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, &param_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 00:20:47 Would be nice if InsertParamSetsAnnexB returns the
- (*subsamples)[0].clear_bytes += param_sets.size();
+ (*subsamples)[0].clear_bytes += frame_buf->size() - old_size;
}
+
+ DCHECK(AVC::IsValidAnnexB(*frame_buf));
return true;
}
« no previous file with comments | « media/formats/mp4/avc_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698