Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Unified Diff: media/filters/source_buffer_state.cc

Issue 2460763002: Fixed track id remapping in MSE FrameProcessor (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/frame_processor.cc ('k') | media/filters/source_buffer_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_state.cc
diff --git a/media/filters/source_buffer_state.cc b/media/filters/source_buffer_state.cc
index 6f588a87f0c44e07f3046c15a86054173e407ec1..5d692c44dde081715cc57842c09a438bb2b590dc 100644
--- a/media/filters/source_buffer_state.cc
+++ b/media/filters/source_buffer_state.cc
@@ -545,6 +545,7 @@ bool SourceBufferState::OnNewConfigs(
std::vector<AudioCodec> expected_acodecs = expected_audio_codecs_;
std::vector<VideoCodec> expected_vcodecs = expected_video_codecs_;
+ FrameProcessor::TrackIdChanges track_id_changes;
for (const auto& track : tracks->tracks()) {
const auto& track_id = track->bytestream_track_id();
@@ -588,7 +589,7 @@ bool SourceBufferState::OnNewConfigs(
if (it != audio_streams_.end()) {
stream = it->second;
if (it->first != track_id) {
- frame_processor_->UpdateTrack(it->first, track_id);
+ track_id_changes[it->first] = track_id;
audio_streams_[track_id] = stream;
audio_streams_.erase(it->first);
}
@@ -644,7 +645,7 @@ bool SourceBufferState::OnNewConfigs(
if (it != video_streams_.end()) {
stream = it->second;
if (it->first != track_id) {
- frame_processor_->UpdateTrack(it->first, track_id);
+ track_id_changes[it->first] = track_id;
video_streams_[track_id] = stream;
video_streams_.erase(it->first);
}
@@ -714,14 +715,9 @@ bool SourceBufferState::OnNewConfigs(
StreamParser::TrackId old_id = stream_itr->first;
StreamParser::TrackId new_id = config_itr->first;
if (new_id != old_id) {
- if (frame_processor_->UpdateTrack(old_id, new_id)) {
- text_streams_.clear();
- text_streams_[config_itr->first] = text_stream;
- } else {
- success &= false;
- MEDIA_LOG(ERROR, media_log_)
- << "Error remapping single text track number";
- }
+ track_id_changes[old_id] = new_id;
+ text_streams_.erase(old_id);
+ text_streams_[new_id] = text_stream;
}
}
} else {
@@ -755,6 +751,11 @@ bool SourceBufferState::OnNewConfigs(
return false;
}
+ if (!frame_processor_->UpdateTrackIds(track_id_changes)) {
+ DVLOG(1) << __func__ << ": failed to remap track ids in frame processor";
+ return false;
+ }
+
frame_processor_->SetAllTrackBuffersNeedRandomAccessPoint();
if (!first_init_segment_received_) {
« no previous file with comments | « media/filters/frame_processor.cc ('k') | media/filters/source_buffer_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698