Index: media/base/media_tracks.cc |
diff --git a/media/base/media_tracks.cc b/media/base/media_tracks.cc |
index 6f3d2c53b6442b6ff0d9d2ee146cfc30a1a039ef..9cfbfbe0bd9fcddc30d0c9ee57d71b717004c3a8 100644 |
--- a/media/base/media_tracks.cc |
+++ b/media/base/media_tracks.cc |
@@ -15,30 +15,36 @@ MediaTracks::MediaTracks() {} |
MediaTracks::~MediaTracks() {} |
-void MediaTracks::AddAudioTrack(const AudioDecoderConfig& config, |
- StreamParser::TrackId bytestream_track_id, |
- const std::string& kind, |
- const std::string& label, |
- const std::string& language) { |
+MediaTrack* MediaTracks::AddAudioTrack( |
+ const AudioDecoderConfig& config, |
+ StreamParser::TrackId bytestream_track_id, |
+ const std::string& kind, |
+ const std::string& label, |
+ const std::string& language) { |
DCHECK(config.IsValidConfig()); |
CHECK(audio_configs_.find(bytestream_track_id) == audio_configs_.end()); |
std::unique_ptr<MediaTrack> track = base::WrapUnique(new MediaTrack( |
MediaTrack::Audio, bytestream_track_id, kind, label, language)); |
+ MediaTrack* track_ptr = track.get(); |
tracks_.push_back(std::move(track)); |
audio_configs_[bytestream_track_id] = config; |
+ return track_ptr; |
} |
-void MediaTracks::AddVideoTrack(const VideoDecoderConfig& config, |
- StreamParser::TrackId bytestream_track_id, |
- const std::string& kind, |
- const std::string& label, |
- const std::string& language) { |
+MediaTrack* MediaTracks::AddVideoTrack( |
+ const VideoDecoderConfig& config, |
+ StreamParser::TrackId bytestream_track_id, |
+ const std::string& kind, |
+ const std::string& label, |
+ const std::string& language) { |
DCHECK(config.IsValidConfig()); |
CHECK(video_configs_.find(bytestream_track_id) == video_configs_.end()); |
std::unique_ptr<MediaTrack> track = base::WrapUnique(new MediaTrack( |
MediaTrack::Video, bytestream_track_id, kind, label, language)); |
+ MediaTrack* track_ptr = track.get(); |
tracks_.push_back(std::move(track)); |
video_configs_[bytestream_track_id] = config; |
+ return track_ptr; |
} |
const AudioDecoderConfig& MediaTracks::getAudioConfig( |