Index: media/base/media_tracks.cc |
diff --git a/media/base/media_tracks.cc b/media/base/media_tracks.cc |
index 832e5a822b12a497f43d01aabc9ef898c55fb7d0..984ca1881baae653eeb6ca8c51f883413d8737e9 100644 |
--- a/media/base/media_tracks.cc |
+++ b/media/base/media_tracks.cc |
@@ -14,30 +14,32 @@ MediaTracks::MediaTracks() {} |
MediaTracks::~MediaTracks() {} |
-void MediaTracks::AddAudioTrack(const AudioDecoderConfig& config, |
- const std::string& id, |
- const std::string& kind, |
- const std::string& label, |
- const std::string& language) { |
+const MediaTrack* MediaTracks::AddAudioTrack(const AudioDecoderConfig& config, |
+ const std::string& id, |
+ const std::string& kind, |
+ const std::string& label, |
+ const std::string& language) { |
DCHECK(config.IsValidConfig()); |
CHECK(audio_configs_.find(id) == audio_configs_.end()); |
scoped_ptr<MediaTrack> track = make_scoped_ptr( |
new MediaTrack(MediaTrack::Audio, id, kind, label, language)); |
tracks_.push_back(std::move(track)); |
audio_configs_[id] = config; |
+ return tracks_.back().get(); |
} |
-void MediaTracks::AddVideoTrack(const VideoDecoderConfig& config, |
- const std::string& id, |
- const std::string& kind, |
- const std::string& label, |
- const std::string& language) { |
+const MediaTrack* MediaTracks::AddVideoTrack(const VideoDecoderConfig& config, |
+ const std::string& id, |
+ const std::string& kind, |
+ const std::string& label, |
+ const std::string& language) { |
DCHECK(config.IsValidConfig()); |
CHECK(video_configs_.find(id) == video_configs_.end()); |
scoped_ptr<MediaTrack> track = make_scoped_ptr( |
new MediaTrack(MediaTrack::Video, id, kind, label, language)); |
tracks_.push_back(std::move(track)); |
video_configs_[id] = config; |
+ return tracks_.back().get(); |
} |
const AudioDecoderConfig& MediaTracks::getAudioConfig( |