diff --git a/packager/media/event/muxer_listener_test_helper.cc b/packager/media/event/muxer_listener_test_helper.cc index 5ee9788452..4a7489b420 100644 --- a/packager/media/event/muxer_listener_test_helper.cc +++ b/packager/media/event/muxer_listener_test_helper.cc @@ -119,10 +119,8 @@ bool MediaInfoEqual(const MediaInfo& expect, const MediaInfo& actual) { // I found out here // https://groups.google.com/forum/#!msg/protobuf/5sOExQkB2eQ/ZSBNZI0K54YJ // that the best way to check equality is to serialize and check equality. - std::string expect_serialized; - std::string actual_serialized; - EXPECT_TRUE(expect.SerializeToString(&expect_serialized)); - EXPECT_TRUE(actual.SerializeToString(&actual_serialized)); + std::string expect_serialized = expect.SerializeAsString(); + std::string actual_serialized = actual.SerializeAsString(); EXPECT_EQ(expect_serialized, actual_serialized); return expect_serialized == actual_serialized; } diff --git a/packager/mpd/base/dash_iop_mpd_notifier.cc b/packager/mpd/base/dash_iop_mpd_notifier.cc index ccd44c6189..7ed8f41d60 100644 --- a/packager/mpd/base/dash_iop_mpd_notifier.cc +++ b/packager/mpd/base/dash_iop_mpd_notifier.cc @@ -21,11 +21,8 @@ const int kStartingGroupId = 1; bool ProtectedContentEq( const MediaInfo::ProtectedContent& content_protection1, const MediaInfo::ProtectedContent& content_protection2) { - std::string s1; - std::string s2; - return content_protection1.SerializeToString(&s1) && - content_protection2.SerializeToString(&s2) && - s1 == s2; + return content_protection1.SerializeAsString() == + content_protection2.SerializeAsString(); } std::set GetUUIDs( diff --git a/packager/mpd/base/mpd_utils.cc b/packager/mpd/base/mpd_utils.cc index 9338d01e3c..a0b27626af 100644 --- a/packager/mpd/base/mpd_utils.cc +++ b/packager/mpd/base/mpd_utils.cc @@ -315,7 +315,9 @@ void AddContentProtectionElementsHelperTemplated( if (entry.has_pssh()) { std::string base64_encoded_pssh; - base::Base64Encode(entry.pssh(), &base64_encoded_pssh); + base::Base64Encode( + base::StringPiece(entry.pssh().data(), entry.pssh().size()), + &base64_encoded_pssh); Element cenc_pssh; cenc_pssh.name = kPsshElementName; cenc_pssh.content = base64_encoded_pssh;