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

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 23072043: Change NeedKeyCB to use std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: media/mp4/mp4_stream_parser.cc
diff --git a/media/mp4/mp4_stream_parser.cc b/media/mp4/mp4_stream_parser.cc
index fc4ee8abd1a20659b0e52100a115bae7172d43c3..51ed7566a8dbfeaf193e5efe684a0c396d0b743f 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -339,14 +339,14 @@ void MP4StreamParser::EmitNeedKeyIfNecessary(
for (size_t i = 0; i < headers.size(); i++)
total_size += headers[i].raw_box.size();
- scoped_ptr<uint8[]> init_data(new uint8[total_size]);
+ std::vector<uint8> init_data(total_size);
size_t pos = 0;
for (size_t i = 0; i < headers.size(); i++) {
- memcpy(&init_data.get()[pos], &headers[i].raw_box[0],
+ memcpy(&init_data[pos], &headers[i].raw_box[0],
headers[i].raw_box.size());
pos += headers[i].raw_box.size();
}
- need_key_cb_.Run(kMp4InitDataType, init_data.Pass(), total_size);
+ need_key_cb_.Run(kMp4InitDataType, init_data);
}
bool MP4StreamParser::PrepareAVCBuffer(

Powered by Google App Engine
This is Rietveld 408576698