OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/webm/webm_tracks_parser.h" | 5 #include "media/webm/webm_tracks_parser.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
10 #include "media/webm/webm_constants.h" | 10 #include "media/webm/webm_constants.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } else { | 185 } else { |
186 MEDIA_LOG(log_cb_) << "Ignoring video track " << track_num_; | 186 MEDIA_LOG(log_cb_) << "Ignoring video track " << track_num_; |
187 ignored_tracks_.insert(track_num_); | 187 ignored_tracks_.insert(track_num_); |
188 } | 188 } |
189 } else if (track_type_ == kWebMTrackTypeSubtitlesOrCaptions || | 189 } else if (track_type_ == kWebMTrackTypeSubtitlesOrCaptions || |
190 track_type_ == kWebMTrackTypeDescriptionsOrMetadata) { | 190 track_type_ == kWebMTrackTypeDescriptionsOrMetadata) { |
191 if (ignore_text_tracks_) { | 191 if (ignore_text_tracks_) { |
192 MEDIA_LOG(log_cb_) << "Ignoring text track " << track_num_; | 192 MEDIA_LOG(log_cb_) << "Ignoring text track " << track_num_; |
193 ignored_tracks_.insert(track_num_); | 193 ignored_tracks_.insert(track_num_); |
194 } else { | 194 } else { |
195 TextTrackInfo& text_track_info = text_tracks_[track_num_]; | 195 text_tracks_[track_num_] = TextTrackConfig(text_track_kind, |
196 text_track_info.kind = text_track_kind; | 196 track_name_, |
197 text_track_info.name = track_name_; | 197 track_language_); |
198 text_track_info.language = track_language_; | |
199 } | 198 } |
200 } else { | 199 } else { |
201 MEDIA_LOG(log_cb_) << "Unexpected TrackType " << track_type_; | 200 MEDIA_LOG(log_cb_) << "Unexpected TrackType " << track_type_; |
202 return false; | 201 return false; |
203 } | 202 } |
204 | 203 |
205 track_type_ = -1; | 204 track_type_ = -1; |
206 track_num_ = -1; | 205 track_num_ = -1; |
207 track_name_.clear(); | 206 track_name_.clear(); |
208 track_language_.clear(); | 207 track_language_.clear(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 282 |
284 if (id == kWebMIdLanguage) { | 283 if (id == kWebMIdLanguage) { |
285 track_language_ = str; | 284 track_language_ = str; |
286 return true; | 285 return true; |
287 } | 286 } |
288 | 287 |
289 return true; | 288 return true; |
290 } | 289 } |
291 | 290 |
292 } // namespace media | 291 } // namespace media |
OLD | NEW |