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

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 11142029: Merge 161369 - Clear source_id_{audio,video}_ after RemoveId. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } 701 }
702 702
703 void ChunkDemuxer::RemoveId(const std::string& id) { 703 void ChunkDemuxer::RemoveId(const std::string& id) {
704 CHECK(IsValidId(id)); 704 CHECK(IsValidId(id));
705 base::AutoLock auto_lock(lock_); 705 base::AutoLock auto_lock(lock_);
706 706
707 delete stream_parser_map_[id]; 707 delete stream_parser_map_[id];
708 stream_parser_map_.erase(id); 708 stream_parser_map_.erase(id);
709 source_info_map_.erase(id); 709 source_info_map_.erase(id);
710 710
711 if (source_id_audio_ == id && audio_) 711 if (source_id_audio_ == id) {
712 audio_->Shutdown(); 712 if (audio_)
713 audio_->Shutdown();
714 source_id_audio_.clear();
715 }
713 716
714 if (source_id_video_ == id && video_) 717 if (source_id_video_ == id) {
715 video_->Shutdown(); 718 if (video_)
719 video_->Shutdown();
720 source_id_video_.clear();
721 }
716 } 722 }
717 723
718 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges(const std::string& id) const { 724 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges(const std::string& id) const {
719 DCHECK(!id.empty()); 725 DCHECK(!id.empty());
720 DCHECK(IsValidId(id)); 726 DCHECK(IsValidId(id));
721 DCHECK(id == source_id_audio_ || id == source_id_video_); 727 DCHECK(id == source_id_audio_ || id == source_id_video_);
722 728
723 base::AutoLock auto_lock(lock_); 729 base::AutoLock auto_lock(lock_);
724 730
725 if (id == source_id_audio_ && id != source_id_video_) { 731 if (id == source_id_audio_ && id != source_id_video_) {
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 1194
1189 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { 1195 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const {
1190 if (audio_ && !video_) 1196 if (audio_ && !video_)
1191 return audio_->GetBufferedRanges(duration_); 1197 return audio_->GetBufferedRanges(duration_);
1192 else if (!audio_ && video_) 1198 else if (!audio_ && video_)
1193 return video_->GetBufferedRanges(duration_); 1199 return video_->GetBufferedRanges(duration_);
1194 return ComputeIntersection(); 1200 return ComputeIntersection();
1195 } 1201 }
1196 1202
1197 } // namespace media 1203 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698