Index: media/webm/webm_tracks_parser.cc |
diff --git a/media/webm/webm_tracks_parser.cc b/media/webm/webm_tracks_parser.cc |
index bf039bf77bde53870e56cc3d0564cebde0c74762..dcc3331d44988d7d2061a42b2fee1536c61499d6 100644 |
--- a/media/webm/webm_tracks_parser.cc |
+++ b/media/webm/webm_tracks_parser.cc |
@@ -25,15 +25,6 @@ WebMTracksParser::WebMTracksParser() |
WebMTracksParser::~WebMTracksParser() {} |
-const std::string& WebMTracksParser::video_encryption_key_id() const { |
- if (!video_content_encodings_client_.get()) |
- return EmptyString(); |
- |
- DCHECK(!video_content_encodings_client_->content_encodings().empty()); |
- return video_content_encodings_client_->content_encodings()[0]-> |
- encryption_key_id(); |
-} |
- |
int WebMTracksParser::Parse(const uint8* buf, int size) { |
track_type_ =-1; |
track_num_ = -1; |
@@ -50,7 +41,6 @@ int WebMTracksParser::Parse(const uint8* buf, int size) { |
return parser.IsParsingComplete() ? result : 0; |
} |
- |
WebMParserClient* WebMTracksParser::OnListStart(int id) { |
if (id == kWebMIdContentEncodings) { |
DCHECK(!track_content_encodings_client_.get()); |
@@ -84,14 +74,16 @@ bool WebMTracksParser::OnListEnd(int id) { |
if (track_type_ == kWebMTrackTypeVideo) { |
ddorwin
2012/10/11 05:18:22
Strange that video is processed first here. It see
xhwang
2012/10/11 16:36:10
Done.
|
video_track_num_ = track_num_; |
if (track_content_encodings_client_.get()) { |
- video_content_encodings_client_ = |
- track_content_encodings_client_.Pass(); |
+ DCHECK(!track_content_encodings_client_->content_encodings().empty()); |
+ video_encryption_key_id_ = track_content_encodings_client_-> |
+ content_encodings()[0]->encryption_key_id(); |
ddorwin
2012/10/11 05:18:22
Why is it the first encoding? Maybe we should comm
xhwang
2012/10/11 16:36:10
Added more comments and more checks. fgalligan@: p
|
} |
} else if (track_type_ == kWebMTrackTypeAudio) { |
audio_track_num_ = track_num_; |
if (track_content_encodings_client_.get()) { |
- audio_content_encodings_client_ = |
- track_content_encodings_client_.Pass(); |
+ DCHECK(!track_content_encodings_client_->content_encodings().empty()); |
+ audio_encryption_key_id_ = track_content_encodings_client_-> |
+ content_encodings()[0]->encryption_key_id(); |
} |
} else { |
DVLOG(1) << "Unexpected TrackType " << track_type_; |