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/filters/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <list> | 9 #include <list> |
10 | 10 |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } else if (text_count == 1) { | 616 } else if (text_count == 1) { |
617 TextConfigItr config_itr = text_configs.begin(); | 617 TextConfigItr config_itr = text_configs.begin(); |
618 const TextTrackConfig& new_config = config_itr->second; | 618 const TextTrackConfig& new_config = config_itr->second; |
619 TextStreamMap::iterator stream_itr = text_stream_map_.begin(); | 619 TextStreamMap::iterator stream_itr = text_stream_map_.begin(); |
620 ChunkDemuxerStream* text_stream = stream_itr->second; | 620 ChunkDemuxerStream* text_stream = stream_itr->second; |
621 TextTrackConfig old_config = text_stream->text_track_config(); | 621 TextTrackConfig old_config = text_stream->text_track_config(); |
622 if (!new_config.Matches(old_config)) { | 622 if (!new_config.Matches(old_config)) { |
623 success &= false; | 623 success &= false; |
624 MEDIA_LOG(log_cb_) << "New text track config does not match old one."; | 624 MEDIA_LOG(log_cb_) << "New text track config does not match old one."; |
625 } else { | 625 } else { |
626 text_stream_map_.clear(); | 626 StreamParser::TrackId old_id = stream_itr->first; |
627 text_stream_map_[config_itr->first] = text_stream; | 627 StreamParser::TrackId new_id = config_itr->first; |
| 628 if (new_id != old_id) { |
| 629 if (frame_processor_->UpdateTrack(old_id, new_id)) { |
| 630 text_stream_map_.clear(); |
| 631 text_stream_map_[config_itr->first] = text_stream; |
| 632 } else { |
| 633 success &= false; |
| 634 MEDIA_LOG(log_cb_) << "Error remapping single text track number"; |
| 635 } |
| 636 } |
628 } | 637 } |
629 } else { | 638 } else { |
630 for (TextConfigItr config_itr = text_configs.begin(); | 639 for (TextConfigItr config_itr = text_configs.begin(); |
631 config_itr != text_configs.end(); ++config_itr) { | 640 config_itr != text_configs.end(); ++config_itr) { |
632 TextStreamMap::iterator stream_itr = | 641 TextStreamMap::iterator stream_itr = |
633 text_stream_map_.find(config_itr->first); | 642 text_stream_map_.find(config_itr->first); |
634 if (stream_itr == text_stream_map_.end()) { | 643 if (stream_itr == text_stream_map_.end()) { |
635 success &= false; | 644 success &= false; |
636 MEDIA_LOG(log_cb_) << "Unexpected text track configuration " | 645 MEDIA_LOG(log_cb_) << "Unexpected text track configuration " |
637 "for track ID " | 646 "for track ID " |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 } | 1753 } |
1745 | 1754 |
1746 void ChunkDemuxer::ShutdownAllStreams() { | 1755 void ChunkDemuxer::ShutdownAllStreams() { |
1747 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1756 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1748 itr != source_state_map_.end(); ++itr) { | 1757 itr != source_state_map_.end(); ++itr) { |
1749 itr->second->Shutdown(); | 1758 itr->second->Shutdown(); |
1750 } | 1759 } |
1751 } | 1760 } |
1752 | 1761 |
1753 } // namespace media | 1762 } // namespace media |
OLD | NEW |