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

Unified Diff: media/tools/media_bench/media_bench.cc

Issue 7466003: MD5Update function uses StringPiece instead of raw buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added valid license Created 9 years, 5 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/tools/media_bench/media_bench.cc
diff --git a/media/tools/media_bench/media_bench.cc b/media/tools/media_bench/media_bench.cc
index 1d3872a43218c3250877e14b508b4d45d776f601..66c3536ee23bb37786d9a7a5924f3d2bb00e479c 100644
--- a/media/tools/media_bench/media_bench.cc
+++ b/media/tools/media_bench/media_bench.cc
@@ -426,8 +426,12 @@ int main(int argc, const char** argv) {
if (hash_djb2) {
hash_value = DJB2Hash(u8_samples, size_out, hash_value);
}
- if (hash_md5)
- base::MD5Update(&ctx, u8_samples, size_out);
+ if (hash_md5) {
+ base::MD5Update(
+ &ctx,
+ base::StringPiece(reinterpret_cast<const char*>(u8_samples),
+ size_out));
+ }
}
} else if (target_codec == AVMEDIA_TYPE_VIDEO) {
int got_picture = 0;
@@ -487,8 +491,10 @@ int main(int argc, const char** argv) {
}
if (hash_md5) {
for (size_t i = 0; i < copy_lines; ++i) {
- base::MD5Update(&ctx, reinterpret_cast<const uint8*>(source),
- bytes_per_line);
+ base::MD5Update(
+ &ctx,
+ base::StringPiece(reinterpret_cast<const char*>(source),
+ bytes_per_line));
source += source_stride;
}
}

Powered by Google App Engine
This is Rietveld 408576698